First time Javascript Object alert -


you can see want do, dont know how.

function setupcards() {     var cards =     {         "1name": "value1",         "1suit": 1,         "1number": 2,          "1active": 0     };    alert( cards.1name ); } 

try using:

alert(cards['1name']); 

because first character of object item begins number.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -