6. I.D., Please


#1



https://www.codecademy.com/courses/objects-ii/1/1?curriculum_id=506324b3a7dffd00020bf661


Hi
It keeps saying make sure your console logs are correct and I know im correct on most of them but I need help on the objects one.


// complete these definitions so that they will have
// the appropriate types
var anObj = { job: "I'm an object!" };
var aNumber = 42;
var aString = "I'm a string!";

console.log(anObj ); // should print "object"
console.log(aNumber  ); // should print "number"
console.log(aString  ); // should print "string"


#2

HI in your console.log()

console.log(anObj ); // should print "object"
console.log(aNumber  ); // should print "number"
console.log(aString  ); // should print "string"

you forgot the key typeof


#3

can you explain that please


#4

you should find the type of variable you have (string, object or number) to do it you should use typeof which work like that

/*here declare a variable and save in it a string*/
var name = "Wiz";

/*here find what type of variable is the variable name */
console.log( typeof name);

#Output
string

#5

It still says my console logs are incorrect what now?

// complete these definitions so that they will have
// the appropriate types
var anObj = { job: "I'm an object!" };
var aNumber = 42;
var aString = "I'm a string!";

console.log(this.job ); // should print "object"
console.log(aNumber ); // should print "number"
console.log(typeof name ); // should print "string"


#6

here

console.log(this.job ); // should print "object"
console.log(aNumber ); // should print "number"
console.log(typeof name ); // should print "string"

it should be like that

console.log(typeof anObj ); // should print "object"
console.log(typeof aNumber ); // should print "number"
console.log(typeof name ); // should print "string"

#7

oh i get it so strings look like these right?


#8

Sorry change it to

console.log(typeof aString ); // should print "string"

#9

ya i got that I figured it out thx
Thats what strings look like right?


#10

I don't understand your question.. what do you mean by Thats what strings look like right?


#11

I had to skip this and come back, not sure why it didnt work the first time but works now!!
Here's the code.

// complete these definitions so that they will have
// the appropriate types
var anObj = { job: "I'm an object!" };
var aNumber = 42;
var aString = "I'm a string!";

console.log( typeof anObj ); // should print "object"
console.log(typeof aNumber ); // should print "number"
console.log( typeof aString ); // should print "string"

#12

There is a bug on this page I had correct code and had to do crtl+r to get it pass.

// complete these definitions so that they will have
// the appropriate types
var anObj = { job: "I'm an object!" };
var aNumber = 42;
var aString = "I'm a string!";

console.log( typeof anObj ); // should print "object"
console.log( typeof aNumber ); // should print "number"
console.log( typeof aString ); // should print "string"