0
How to make dictionary through JavaScript
suggest me
2 odpowiedzi
+ 3
Just do object...
var dict = { 'key': 'value', 'answer': 42 };
alert(dict['key']); // output "value"
alert(dict.answer); // output 42
dict.key = 'forty two';
dict['answer'] = 0;
dict.newkey = "new value";
alert(dict['key']); // output "value"
alert(dict.answer); // output 42
alert(dict['newkey']); // output "new value"
0
thanks