If you are reading this, the chances are high that you already studied algebra at some point during your schooling. The difficulty levels at which you learned algebra will likely differ from case to case, but we will use it as a comparison here by talking about some of its most standard concepts.
Even if it has been many years since you opened up an algebra book, you probably remember simplistic things such as this: a = 6, b = 9, c = a + b
Example 1: var z; Example 2: var cityname;
In Example 1, we declare or create the z variable. Since we said you could use more descriptive names as well, we did just that in Example 2, declaring the cityname variable. In these examples, all we did was declare variables that do not have any values. Think of them as empty storage spaces.
What if we wanted to not only declare or create variables, but also give them values at the same time? Doing so is easy, and here are two examples:
Example 3: var z=6; Example 4: var cityname=”Miami”;
In Example 3, we declare the z variable and assign it the value of 6. In Example 4, we declare the cityname variable and assign it the value of Miami. As you can see in Example 4, we put quotation marks around the value Miami. You should always remember to put quotation marks around any text values.
Example 5: z=6; Example 6: cityname=”Miami”;
Example 7: b=a-6; Example 8: c=b+6;
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.