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...
-
I'm working on an attendance audit screen which allows the user to single click to confirm the selection and double click to create a re...
-
You cannot achieve the fixed row and column with HTML + CSS. You need the Javascript as well. Below is the HTML, CSS and Javasript th...
No comments:
Post a Comment