title: Curry my Functions without lodash
body: <p>I've been dabbling with functional programming for a little bit and I'm trying to get my head around partial application and currying.</p>
  
  <p>I'm looking for some insight on how I can apply <strong>partial application</strong> and <strong>currying</strong> to the functions below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="true">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var Page_Validators = [{
    "controltovalidate": "Content_C002_txtAddress",
    "focusOnError": "t",
    "errormessage": "No Address Entered",
    "display": "Dynamic",
    "validationGroup": "ProfileControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_txtCity",
    "focusOnError": "t",
    "errormessage": "No City Entered",
    "display": "Dynamic",
    "validationGroup": "ProfileControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_drpState",
    "focusOnError": "t",
    "errormessage": "State Required",
    "display": "Dynamic",
    "validationGroup": "ProfileControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_txtZipcode",
    "focusOnError": "t",
    "errormessage": "No Zipcode Entered",
    "display": "Dynamic",
    "validationGroup": "ProfileControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_phoneNumberFull",
    "focusOnError": "t",
    "errormessage": "Missing Phone Number",
    "display": "Dynamic",
    "validationGroup": "ProfileControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_txtSupFullName",
    "focusOnError": "t",
    "errormessage": "No Name Entered",
    "display": "Dynamic",
    "validationGroup": "SupervisorControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_txtSupTitle",
    "focusOnError": "t",
    "errormessage": "No Title Entered",
    "display": "Dynamic",
    "validationGroup": "SupervisorControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_txtSupPhoneFull",
    "focusOnError": "t",
    "errormessage": "Missing Phone Number",
    "display": "Dynamic",
    "validationGroup": "SupervisorControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_txtSupEmail",
    "focusOnError": "t",
    "errormessage": "No Email Entered",
    "display": "Dynamic",
    "validationGroup": "SupervisorControl",
    "initialvalue": "",
    "isvalid": true
  }, {
    "controltovalidate": "Content_C002_SignatureField",
    "focusOnError": "t",
    "errormessage": "Signature Required",
    "display": "Dynamic",
    "validationGroup": "ProfileControl",
    "initialvalue": "",
    "isvalid": true
  }];
  
  
  function filterArrayBy(arr, searchString) {
    return arr.filter(key =&gt; key.controltovalidate.toLowerCase().includes(searchString.toLowerCase()));
  }
  
  function toggleValidatorsState(arr, condtion) {
    return arr.map(el =&gt; ValidatorEnable(el, condition));
  }
  
  const supervisorValidators = filterArrayBy(Page_Validators, "txtSup");
  const disabledValidators = toggleValidatorsState(supervisorValidators, true);
  
  console.log(disabledValidators);</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>ASIDE</strong></p>
  
  <p>The toggleValidatorState function is invoking an ASP.NET function so the code snippet will not function (unless you have asp.net)</p>
  
  <p>Except for the ASP.NET function can these functions be simplified or make use of partial application with currying??</p>
  
  <p>I feel like I'm repeating myself by having to pass an array into the two functions.</p>
  
  <p>I've been looking into using Lodash or Ramda but could I achieve the same without the use of an external library.</p>