6/30 Cant get this


#1

Here is my code: it prints the right thing but it shows an error:

// 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.job); // should print "object"
console.log(aNumber); // should print "number"
console.log(aString); // should print "string"


#2

@minions2001,

I think you will have to use the typeof operator
like in

console.log(typeof aNumber);

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof

The associated VALUE can be anything from:

•Number
•String
•Boolean
•Symbol
•Object  ◦Function/'Method'
         ◦Array
         ◦Date
         ◦RegExp
         ◦Math
•Null
•Undefined

Above you have an overview of all data-types.


#3

6/30 Here is the correct code. I just piggy offed the previous example and found another error. In anObj.job it needs to be anOjb only.

// 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"