object declearariton in javascript code example
Example 1: js obj
var obj = {my:"sql", nice:[69, 420]};
obj.my //returns the string "sql"
obj.nice //returns the array [69, 420]
Example 2: how to a property from a JavaScript object
delete myObject.regex;
// or,
delete myObject['regex'];
// or,
var prop = "regex";
delete myObject[prop];
/** Demo */
var myObject = {
"ircEvent": "PRIVMSG",
"method": "newURI",
"regex": "^http://.*"
};
delete myObject.regex;
console.log(myObject);