making objects in javascript code example
Example 1: Build JavaScript Objects
var myDog = {
name: "gozi",
legs: 4,
tails: 1,
friends: ["Ted", "Fred"]
};
Example 2: create object javascript
const object = {
something: "something";
}
Example 3: js create new object
let bike = { name: 'SuperSport', maker:'Ducati', start: function() { console.log('Starting the engine...'); }};bike.start();
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);