My mind is blanking on Know Thyself


#1



syntax error
unexpected identifier


Replace this line with your code. 
var myObj = {
    // finish myObj
    var prop: "name";
};

console.log( myObj.hasOwnProperty('name') ); // should print true
console.log( myObj.hasOwnProperty('nickname')) ; // should print false


#2

Inside of myObj, you just need the key name and the value of your name such as this:
name: "Kylea"


#3

still giving me the unexpected identifier error


#4

var myObj = {
// finish myObj
var name: "klea";
};

console.log( myObj.hasOwnProperty('name') ); // should print true
console.log( myObj.hasOwnProperty('nickname')) ; // should print false


#5

@ibridges, from instructions:

Literal notation creates a single object. Literal notation uses curly brackets { } and the object's default properties are defined within the brackets using property:value notation.

So, as @kyleaw said,

Inside of myObj, you just need the key name and the value of your name such as this:
name: "Kylea"

In your case should be:

var myObj = {
// finish myObj
   name: "klea" // if you have one property you don't need ;
};

Keyword var is the variable statement declares a variable, optionally initializing it to a value.


#6

He needs to remove semi-colon from the object after the name,


#7

remove semi-colon from there, hopefully it will work,
leave it empty..lol
I love to debug code :slight_smile:


#8

@microsurfer22225, did you read my post ?


name: "klea" // if you have one property you don't need ;

He needs to remove keyword var before property name and semi-colon after property value.


#9

lol... no i didn't read it, anyway you are right
did you finish javascript?
Thank you so much deny :slight_smile:


#10

I finished JavaScript course and now I'm learning Learn JavaScript course :slight_smile:


#11

Are you learning the same course or different one? I know there are two courses of javascript and after you finish javascript you can apply for javascript libraries like angular ,node etc


#12

I'm learning the new Codecademy course.


#13

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