I have two arrays: newParamArr[i] and paramVal[i] .
Example values ββin the newParamArr[i] array: ["Name", "Age", "Email"]
Example values ββin the paramVal[i] array: ["Jon", "15", " jon@gmail.com "]
I need to create a JavaScript object that puts all the elements in an array into the same object. for example
{newParamArr[0]:paramVal[0], newParamArr[1]:paramVal[1], ...}
The length of two arrays is always the same, but the length of the arrays can increase or decrease. How in...
newParamArr.length === paramVal.length will always return true.
None of the posts below would help answer my question:
Javascript recursion to create a JSON object
Scroll recursively to create a property list
javascript
user6535476
source share