Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
Source by htmlcheatsheet.com #
 
PREVIOUS NEXT
Tagged: #create #object #javascript
ADD COMMENT
Topic
Name
5+3 =