I'm still sort of new to JavaScript and so I was playing around with some Javascript. I used let car = null;
and had console.log(car)
into the console which came up to null of course. I then console.log(typeof car)
into the console this time but came back as an object. I was wondering why since I let car = null
?
let car = null; console.log(car); //came back as null console.log(typeof car); //came back as object
So I thought that would come back as null as well after I console.log(typeof car);
but didn't and came back as an object.