Of course, we have only declared the variables in the example above. We have not set any value to them, which means that they are currently empty or null.
In the example above, we can see that the variable stringExample is set to "This is a string", where the string must be in quotes. The intExample is set to 7, since 7 is a integer, it shouldn't be in quotes. The booleanExample is set to true, since true is a boolean value. (Quick Note: true and false are the only two values a boolean can be set to.)
Try to keep a consistent naming scheme when naming variables. Notice how I divided the "words" by lowering the first word and capitalizing the letter of the next word. Also, try to name variables with a sense of what their purpose is. An example would be var numberOfTurtles = 7.
Your code will execute in this window.
Let's explore some more tutorials or topics!
No comments yet... Be the first!