I am trying to push object into an array
I have something like these
for(var i=0; i<test.length; i++){
console.log(test[i])
console.log(items[test[i]])
productObj.push( { test[i] : items[test[i]]} );
}
both console.log show stuff but I have an error on the push()
. The error is "Uncaught SyntaxError: Unexpected token [
"
Can anyone help me about this weird issue? Thanks!