I have an array valueArray[]
with a length of 8
, I want to take each index value of the array and assign it to a variable and achieve this -
var valueArray = ["itemName", "itemType"]
var name = valueArray[index 1];
var type = valueArray[index 2];
myFunction(name,type)
Would anyone know how to get this? Loops don't work as the same variable will only change its value.