a smarter way to learn javascript
my journey of using an e-book called a smarter way of learning JS to learn... (drumroll) javascript.
here's a link to the pdf that i am using!
chapter 1
okay so i am learning stuff for alerts it's like this:
alert("this is an alert!");
chapter 2: declaring variables
06.mar.24
i learned about declaring variables aka var
and assigning it a string!
example: var cat = "black with white socks"
and if i wanna do another string to the same var
i can go cat = "orange and white"
i can also use let
for this
chapter 3: numbers
07.mar.24
a number is not enclosed in quotes! if it is, JS will read it as a string
example: var number = 50;
you can do math with this shit. example:
var cookiesIveEaten = 5;
var totalCookiesIveEaten = cookiesIveEaten + 2;
the result of this will be this:
chapter 4: variable naming rules
- only $, _
- variable cannot start with a number
chapter 5: math expressions: familiar operators
i can do math with javascript with these - + * /
i am not sure what a modulus (this thing %
) exactly does tbh... will search more on this later
chapter 6: math expressions: unfamiliar operators
31.mar.24
learning about x++
and x--
good lord this one was a bit confusing....
okay so num++;
is a short way of writing num = num + 1;
but then when used in this example it confuses me so much... bc to me this makes no sense
i just dont get how "the 2nd statement boots its value to 2." and yet newnum
gets the original value of 1. that's what i'm having trouble wrapping my head around...
maybe i'll get it in the long run LOL.