I have an array with few values. I want to iterate over array and add those values to an object as value starting from second object element which has null value. I cannot figure out how can I do it properly. Here is my code
let objectParameters = {
"current_lang" : currentLang,
"project_name" : null,
"project_type" : null,
"min_price" : null,
"max_price" : null
}
let arrayValues = ["Project name", "Project Type", 150, 950];
arrayValues .forEach(function(item) {
//Add array value to an object
}
Desired output
let objectParameters = {
"current_lang" : currentLang,
"project_name" : "Project name",
"project_type" : "Project Type",
"min_price" : 150,
"max_price" : 950
}
["Project name", "Project Type", 150, 950]array will be same always ?