Answers for "what is an object literal in javascript"

0

how to create an object in javascript

const person = {
  name: 'Anthony',
  age: 32,
  city: 'Los Angeles',
  occupation: 'Software Developer',
  skills: ['React','JavaScript','HTML','CSS']
}

//Use Template Literal to also log a message to the console
const message = `Hi, I'm ${person.name}. I am ${person.age} years old. I live in ${person.city}. I am a ${person.occupation}.`;
console.log(message);
Posted by: Guest on October-09-2020
0

javascript object literal and json

var obj = {foo: 42}; // creates a JavaScript object (this is *not* JSON) 
 var json = '{"foo": 452}'; // creates a string containing JSON
Posted by: Guest on May-19-2020

Code answers related to "what is an object literal in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language