let myName = "codeyup"; console.log(myName);
In the above example, I have declared a variable (myName) using let whose value is codeyup and it is a string. You will read more about var, let, and const in the next blog posts.
let a = 21; let b = 39; console.log(a + b);
In the above example, I have declared two variables (a and b) whose values are 21 and 39. These are Number data types.
Note: Values that we write in ” “ are treated as a string value. Suppose I write “4” then it is a string data type.
let a = "2"; //It is a string data type let b = 2; //it is a number data type
1. Camel case
You can also write the first alphabet in capital if you want to write in that way.
You can write the second word by using an underscore.
3. Using the $ symbol
You can write the second word by using an $ symbol.
let function = 160;
let $function = 20; console.log($function);
This way you can declare it. The output of the above is 20.