As I said last week, the best way to do this kind of tutorial is through video, but I don’t have the right tools to do something of good quality video now. So, if you are a starter wish to follow me on this, it would be great.
Before you continue read this to know my current plan for this progressive JS tutorial.
So, let’s roll!
First, you need to create your index.html file and a file for app.js. then you source/link to external .js file on the Html. Also, if you use VSCode, I suggest that you download a live server extension. This will save the stress of reloading the page every time you save file because it automatically loads up. As shown in the image below.
We will be using chrome console to output our work, and there is a lot with chrome console, but I will not talk about it here. I will dedicate a section for it. Just hop in your chrome browser and press f12 key to open it up.
This is primary. When you use var or let, you can reassign the variable but you can’t reassign when you used const.
Variable can only be letters, numbers, _,$ and can’t start with a number else there will get an error.
The images below contain the processes and comments for explanation. They are all progressive and you can open them up with OPEN IMAGE IN NEW TAB if it not clear enough.
That is all you need to understand basically about variables and declaration. If you are a starter and you have questions, kindly use the comment section.