More About Variables – JavaScript Series – Part 7
Muhammad Ali (Nerdjfpb) - Jan 24 '20 - - Dev Community
In last part we learned about variables right ? Now today we are going to learn a bit more about variables.
We can't start variable name with symbol. Like -
Variable can start with a letter than numbers, it's fine. But no way to start numbers
But you can start a variable with _ & $
We can't have space in variable name and if we need a long variable name. Then we use camelCase. Which means you'll write in big letter the second word. example -
Let do a little easy trick with variable. First we'll get two variable and add them and store it on a new variable, then we'll see if we got the exact value
Another thing, we can change the types of variable just by storing that value on there, like -
What if we didn't mention any type while initialing a variable. It will be undefined. This is another type of JS, we didn't learn at first. If you never initialize a variable but trying to call it, then it will give you a reference error
Do you learn some new stuff today ?
You can see the graphical version here
Source Codes - { Check commits }
A tutorial for JavaScript Beginners
javaScript-Series
A tutorial for Absolute Beginners of JavaScript.
You can find the total pdf in - Here
You can check the commits to find the part by part codes.
Blogs
-
Day 1 - What is JavaScript?
-
Day 2 - JavaScript Types?
-
Day 3 - Javascript Types Cont.
-
Day 4 - Javascript Types Cont.
-
Day 5 - Javascript Comparisons
-
Day 6 - Javascript Variables
-
Day 7 - More About Variables
-
Day 8 - Conditional Statement
-
Day 9 - More Conditional Statement
Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !