# Differences between Variables and Operators in JS # Javascript is a dynamic language which provides the behavior to the website. If you are a student of any [web design course in Delhi](https://www.admecindia.co.in/course/most-advanced-web-design-development-master-plus-course/) then you must know about this language. Variables in javascript are like containers they are used to store different kinds of values, and operators are used to evaluate the expressions in the javascript. This blog is all about the differences which lie between variables and operators of JS. **Variables** Variables are the containers, which can store the hold the values in it and it can be vary, and changeable for later use. In javascript we have three reserved keyword for defining the variables. **Var** It is used to defined the variable in the javascript, the variables defined by using the var keyword are function scope. **Let** let is also used to define the variables in the javascript, and the variables declared by using the let keyword are block scope. **Const** const is used to define a constant variable in the javascript, the constant variables cannot be modified. Let us see an example of var and let keywords and their differences: function run() { var foo = "Foo"; let bar = "Bar"; console.log(foo, bar); // Foo Bar { var moo = "Mooo" let baz = "Bazz"; console.log(moo, baz); // Mooo Bazz } console.log(moo); // Mooo console.log(baz); // ReferenceError } run(); **Operators** Operatore are also works same in javascript as other programming languages, the operators performs the operations on the operands on the single or the multiples data values. Following are the categories of the operators in the javascript: **Assignment Operator** An assignment operator is used to assigns the values to it’s left hand side operands, which is based on the right hand side operands, and the assignment operator is simply denoted by the ( = ) operator. Let us see an example of an assignment operator: var a = 12; **Comparision Operator** Comparision operator is used to compare the values, we can use compare ( == ) or strict compare operator ( === ), they both do comparision but have some difference. Equal to operator will return true if the data matches: 5 == ‘5’ It will return in equal to comparison. Strict equal to will return true only when the data and the data type both are same. 5 === ‘5’ It will return false in strict equal to comparision. **Arithmetic Operator** As the name says, it is for mathmetical operations. Standard operators of the arithmetic operator ( +, -, *, / ) Operators of arithmetic: Remainder ( % ) operator will return the by dividing the two operands. Increment ( ++ ) operator will increase the value while the decreament ( - - ) operator will decrease the value of the operand by one value. **Logical Operator** Logical operator is used with Boolean values, some of the logical operators are logical AND, logical OR, logical NOT. **String Operator** The same addition operator can be used in javascript to concatenates two different string values. And will return the union of the two operands. Let see an example: console.log('my ' + 'string'); // console logs the string "my string". **Conditional Operator** Conditional operator will take three operands, let see the syntax: condition ? val1 : val2 If the condition is true, then the first value, val1 will be returned otherwise the second value val2 will be returned. These are some of the main differences of the variables and the operators in JS. Check courses given below to learn JS like a pro: • [JavaScript Classes in Delhi](https://www.admecindia.co.in/course/most-advanced-course-javascript-master-plus-plus/) • [JavaScript Training in Rohini](https://www.admecindia.co.in/course/advanced-javascript-master-plus-course/) • [JavaScript Course in Delhi](https://www.admecindia.co.in/course/best-javascript-master-course/) All of these courses are offered by [ADMEC Multimedia Institute](https://www.admecindia.co.in/). Apart from these, there are other [web design courses in Delhi](https://www.admecindia.co.in/courses/web-design-courses-delhi/) along with [web development courses in Delhi](https://www.admecindia.co.in/courses/web-development-courses-delhi/) that students can join.