how to access properties of an object in javascript code example
Example 1: create object javascript
const object = {
something: "something";
}
Example 2: how to a property from a JavaScript object
delete myObject.regex;
delete myObject['regex'];
var prop = "regex";
delete myObject[prop];
var myObject = {
"ircEvent": "PRIVMSG",
"method": "newURI",
"regex": "^http://.*"
};
delete myObject.regex;
console.log(myObject);
Example 3: js create object with properties
var mycar = new Car('Eagle', 'Talon TSi', 1993);
Example 4: javascript object string property
myObject['thing'] = true;
Example 5: how to create a object in javascript
var about = {
name:"lanitoman",
age:1023,
isHeProgrammer:true
}