Objects in Js


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/2/3

me.name="xyz";
me.age=14;

What is wrong in this ?


#2

exercise url? error message? Without those details, its much more difficult to help you


#3

me.name http://me.name="xyz";
me.age=14;
This is the code .
chapter-Creating a new object


#4

you forgot to create the object first


#5

Will you give me an example of this?


#6

https://www.codecademy.com/en/courses/spencer-sandbox/1/5?curriculum_id=506324b3a7dffd00020bf661

Literal notation:

var myObject = {}; // it's better, primitive values execute much faster.

Constructor notation:

var myObject = new Object();

#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.