JSFiddle - React, Tailwind, and code Playground
by Jessie Lau
JavaScript
function arrayToHash(arr1,arr2){
var myObj = {};
for(var i = 0; i < arr1.length; i++){
myObj[arr1[i]] = arr2[i];
}
return myObj;
}
console.log(arrayToHash([1,2,3], ["hey", "hello", "Hola"]));