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

apache - setting document root in antoher partition on ubuntu -

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

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -