creating objects javascript code example
Example 1: object literal javascript
var myObject = {
sProp: 'some string value',
numProp: 2,
bProp: false
};
Example 2: javascript object
let names = {
name1: 'What ever you want to put'
}
Example 3: 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);