DEV Community

Nimal Anand
Nimal Anand

Posted on

Javascript variables

variable types:
1)var 2)let 3)const
var:It denotes the variable which we intend to introduce.For example variable equals 5. If we use var it can be reassigned and reinitialised meaning we can call the variable name again and we can also change value of the variable as well..

let:if we use let and introduce a variable.it cant be reassigned but the value can be reinitialised meaning we can give another value for the same variable.

const:Meaning of const is constant. if we introduce a variable using const it cant be reassigned or reinitialise.

Arithmatic operator:
arithmatic operators are used for doing mathematical operations like addition subtraction multiplication division.

Addition operator(+) It performs two operations like adding numbers and doing concardination.It adds the numbers and on the other hand it concordinates the given data types whatever it maybe

Subtraction(-) It is used to perform subtraction between two variables which is declared earlier

Multiplication(*)It is used to perform multiplication between two variables.

Division It is used to perform division between two variables.we use slash(/) to get the quotient value and we use modulo (%) to get the remainder.

Top comments (0)