Variables and Statements
I have an easy way of declaring constants and variables (integer, string, arrays etc). Why?
- I am dynamically typed language (means you don't have to worry about the type of variable like integer, string etc. I will do it for you at runtime).
- I provide 3 keywords const, var, let to declare variables.
1- var (MDN)
As I previously mentioned that I am dynamically typed so you can use only var to declare all type of variables. Try it on JSBin
2- const (MDN)
const is like constant. Once you declare and define, then you can't change the value of that constant (myName in our case) thereafter.
3- let (MDN)
let works similar to var but let is block scoped. (block-scoped is an advanced feature and you can read on MDN).
Note: Just use const for constants and let for variables instead of var.