Learn JavaScript OBJECTS in 7 minutes! 🧍
Bro Code Bro Code
1.85M subscribers
33,066 views
0

 Published On Nov 14, 2023

#JavaScript #tutorial #course

// object = A collection of related properties and/or methods
// Can represent real world objects (people, products, places)
// object = {key:value,
// function()}

const person1 = {
firstName: "Spongebob",
lastName: "Squarepants",
age: 30,
isEmployed: true,
sayHello: function(){console.log("Hi! I am Spongebob!")},
eat: function(){console.log("I am eating a Krabby Patty")},
}

console.log(person1.firstName);
person1.sayHello();
person1.eat();

show more

Share/Embed