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 }
nerdjfpb / javaScript-Series
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
- Day 1 - What is JavaScript?
Day 2
- Day 2 - JavaScript Types?
Day 3
- Day 3 - Javascript Types Cont.
Day 4
- Day 4 - Javascript Types Cont.
Day 5
- Day 5 - Javascript Comparisons
Day 6
- Day 6 - Javascript Variables
Day 7
- Day 7 - More About Variables
Day 8
- Day 8 - Conditional Statement
Day 9
- Day 9 - More Conditional Statement
Day 10
- Day 10 - Switch
Day 11
- Day 11 - Setup Code Editor
Day 12
- Day 12 - Loops
Day 13
- Day 13 - While Loop
Day 14
- Day 14 - For Loop
Day 15
- Day 15 - For Vs While
Day 16
- Day 16 - Functions
Day 17
Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !
Top comments (0)