what is an object literal javascript code example
Example 1: object literal javascript
var myObject = {
sProp: 'some string value',
numProp: 2,
bProp: false
};
Example 2: literal object js
var car = {type:"Fiat", model:"500", color:"white"};
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);