javascript strings vs numbers 1

javascript strings vs numbers

let message = 'hello'; //string
let sum = 5;           //number
let x = -15.25;        //number
let year = "2021";     //string

Here is what the above code is Doing:
1. We’re creating a variable called message and assigning it the value of the string “hello”.
2. We’re creating a variable called sum and assigning it the value of the number 5.
3. We’re creating a variable called x and assigning it the value of the number -15.25.
4. We’re creating a variable called year and assigning it the value of the string “2021”.

Similar Posts