Unique object literal keys- javascript -


var obj = {"":"empty string", "!":"bang", "hello world":"hello world"} 

-fix these lines of code works?

whatever method i've tried, keep coming undefined property name "" or error when calling !.

i'm new coding , not looking answer, maybe push in right direction..so please gentle ,

you must call obj array

console.log( obj [''] ); // "empty string" console.log( obj ['!'] ); // "bang" var x='!'; console.log( obj [x] ); // "bang" 

Comments

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -