parts of an object javascript code example
Example 1: js obj
var obj = {my:"sql", nice:[69, 420]};
obj.my
obj.nice
Example 2: objects javascript
function Dog() {
this.name = "Bailey";
this.colour = "Golden";
this.breed = "Golden Retriever";
this.age = 8;
}
Example 3: javascript object
const object = {
something: "something";
}
Example 4: how to create an object in javascript
const person = {
name: 'Anthony',
age: 32,
city: 'Los Angeles',
occupation: 'Software Developer',
skills: ['React','JavaScript','HTML','CSS']
};
const message = `Hi, I'm ${person.name}. I live in ${person.city}.`;
console.log(message);