In Javascript, an object is a name value collection.
// the shorthand to declare an new object,.
var o = {};
// set the age to 18.
o['age'] = 18;
// you have 2 ways to retrieve the age:
// property style:
console.log(o.age);
// name value collection style:
console.log(o['age']);
// you may also assigning the value with the "name" that can't be access in "property" style.
o['abc-1'] = 1;
o['name 1'] = 2;
console.log(o['abc-1']);
console.log(o['name 1']);
Subscribe to:
Post Comments (Atom)
We are moving
We are moving this blog to our new blog site: https://ciysys.com/blog/nodejs.htm
-
Overview Usually, we start developing a new system with designing database and then writing codes. If you are not a fan of ORM, you will h...
-
Below is the sample HTML which will hide the URL at the page header when printing with Javascript. <html moznomarginboxes > ...
-
You can draw a simple pie chart & doughnut chart with SVG + CSS. This is quite simple and straight forward. But the limitation is that i...
No comments:
Post a Comment