Tell us what’s happening: So far, for every freeCodeCamp lesson, if I don’t understand something, which is in the text portion of the lesson, then I generally understand it when I watch the video. In this lesson, however, I understand everything in the lesson EXCEPT the note. What is the note trying to say? When I watched the video–it talked about the lesson, but didn’t explain what is meant by the note.
The note says:
Note: In JavaScript, you can determine the type of a variable or a value with the typeof operator, as follows:
typeof 3
typeof '3'
typeof 3 returns the string number , and typeof '3' returns the string string .
What are we to learn from this? Is “typeof” code? Pseudo code to explain a principle? Did I miss something about the typeof or is there more coming later in the course?
Anything wrapped in quotes "" are strings even if you put a number in it shows as a string. If it is a number and is not in quotes it is a number. typeof is just an operator in JavaScript
Thank you to both of you for your thoughtful and helpful answers. I did dig a bit deeper, after reading over both of your replies and the link.
I did find this typeof operator presented in the Debugging unit later in this course’s challenges. So I don’t think anyone coming across this challenge’s note about typeof needing to be too concerned about not fully understanding how and when to use it from this challenge alone–as the later course materials go into it more in depth.