Skip to content

Instantly share code, notes, and snippets.

@andrit
Created September 21, 2018 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrit/9044bc82dbc73f610d6c250b75820af1 to your computer and use it in GitHub Desktop.
Save andrit/9044bc82dbc73f610d6c250b75820af1 to your computer and use it in GitHub Desktop.
takes a state array, like: 0: { hashKey: "5bdbeca67ac99d2e1389e154044585f8f8639bf5" value: "APPLE"} matches Hashes and puts values into array of values for each exclusive hash
 createApiCheckboxArray = (arr) => {
    /**
     * array.keys
     */
    arr.map((item, i) => {
      if(item.hashKey === i.hashKey){
        let valArr = [];
        valArr.concat(i.value);
        Object.assign({item.hashKey}, valArr)
      }
    })

    ///create whole new array : selectedCheckboxesAPI, concat the three Objects to the array
    //pass this to handleExtraInfoFormSubmit as checkboxAnswers variable
    //remove selectedChecboxesFinal from selectedCheckboxes function
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment