objects javascript
function Dog() {
this.name = "Bailey";
this.colour = "Golden";
this.breed = "Golden Retriever";
this.age = 8;
}
objects javascript
function Dog() {
this.name = "Bailey";
this.colour = "Golden";
this.breed = "Golden Retriever";
this.age = 8;
}
js create object with properties
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}
how to access object properties js
const person1 = {};
person1['firstname'] = 'Mario';
person1['lastname'] = 'Rossi';
console.log(person1.firstname);
// expected output: "Mario"
const person2 = {
firstname: 'John',
lastname: 'Doe'
};
console.log(person2['lastname']);
// expected output: "Doe"
how to access property of an object in javascript
objectName.propertyName
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us