Variables are very important to know about when coding in Javascript. Variables are used to store data, therefore they have a very important role in coding. You initialize a variable by putting an equals sign next to it followed by the value that you want it to contain. This is done so that way you are able to assign values to variables. For example, as we have seen many times, the let myText= “hello world!”; example shows how we assign the variable myText to the value of “hello world!”. Moving onto the declaration of variables, where you declare the creation of variables and functions. This takes the initializing step one step further. Lastly, there are important rules to note when naming variables. Variables cannot begin with a number and no spaces are allowed at any time. Variables can be as short or as long as you desire, and you can mix and match uppercase & lowercase letters, numbers, and characters. All in all, variables are essential for coding, and you would not be able to code without the knowledge of those variables.
Image link: https://mclark45.medium.com/variables-8d0ba47d9694
Leave a Reply
You must be logged in to post a comment.