This week was a difficult one because we were learning JavaScript and I knew nothing about it. This is more of my sister’s thing. She is a Graphic Designer. Anyway, variables are identifiers. Identifiers of data being entered. We create a variable by using the keyword let and after typing the name we came up with for the variable. This is how we declare a variable let yourname. This is how we initialize a variable let yourname= “Isel Sainte”; When naming a variable, the length does not matter, it can start with a letter/underscore/dollar sign, you can mix and match lowercase and uppercase letters, a number is not allowed, spaces are also not allowed.
Here is what arithmetic operators in JavaScript, and what they all do:
+ it adds
– it subtracts
* it multiples
/ it divides but this result is a floating-point number
% it divides but this result gives the remainder
Order of operation is important when using the arithmetic operators.
Hi Isel, I felt the same way when we first started covering JavaScript, it almost felt like I was reading a foreign language. I thought your breakdown of what variable is and your example of how it is utilized in JavaScript is great for those who are still confused on what a variable is and how it utilized. The rules and requirements can definitely be tricky to remember all of them but they are essential when writing code in JS!
Hi Isel, I definitely feel the same when it comes to Javascript. Coding is something I never thought I would have to do, surprisingly. Javascript is very difficult to understand in my opinion, but after practicing a little bit of code it has definitely a little bit better to comprehend. When having difficulties with understanding Javascript, I have definitely referred to the textbook a lot more and feel that it really helps a lot with understanding what may be confusing. There are a lot of good resources when needing to understand Javascript and highly recommend looking into it if you’re interested! I think variables were one of the Javascript learning objectives that were easier to comprehend versus the other factors we had to learn as well. To help me memorize what a variable does, I thought of a neat (maybe not, who knows) trick where when thinking about variables I take the last three letters of ‘les’ and realize that for a variable I need to change it from ‘les to ‘let’. And then therefore, that helped me figure out that let is the variable we need to use.