Let’s Start with Some Basic Coding!
JavaScipt is a Dynamic, Untyped, and Interpreted language with both Object-Oriented and Functional Programming paradigms baked into it. As you read through our blog postings you will start to learn what some of this stuff means, but for right now its probably best just focus on the “Interpreted” part.
var x = "Hello, World!" then press the enter key, the console will spit back
undefined. The reason we see
undefined rather than
"Hello, World!" is because assigning a variable has no return value (This isn’t important yet, just keep it in mind). In this really simple case, we are assigning the string
Hello, World" to the variable x and the console is spitting back the return value of running a variable definition
If we type in just the string portion
"Hello, World!", the console will spit back
'Hello, World!' and if we just enter x into the console we will now receive the string
"Hello, World!" as well. What we’ve done is assign the value of the string
"Hello, World!" to the variable x. The assignment of x can be changed (is mutable) and has a lifetime as long as the window or tab is open (once you close the window the console will clear all variable assignments.) You may also simply refresh your page to clear your data assignments from the console.