access key value pair in javascript code example
Example 1: key value pair array in javascript
var myArray = {id1: 100, id2: 200, "tag with spaces": 300};
myArray.id3 = 400;
myArray["id4"] = 500;
Example 2: javascript object get value by key
var obj = {
a: "A",
b: "B",
c: "C"
}
console.log(obj.a); // return string : A
var name = "a";
console.log(obj[name]);