Conditional Statements : if, else, if else if, switch
Looping Statements : while, do..while, for, for..in
Part 3 (Coming Soon)
Understanding the Scope : Availability of variables globally or locally
Part 4 (Coming Soon)
Understanding Objects Literals
Understanding the DOM : Document Object Model
Variables, DataTypes, Operators and Expressions
Global variables (Global Scope)
Local and Block level variables (Local Scope)
Let’s look at some code.
Numbers : eg: 157, 457
Strings : eg: “This is string”, ‘This is string’
Booleans : eg: true or false
For ex: If we assign 124 value to a variable var myValue = 124. The data type for myValue will be Number.
Let’s look at some code and find out the data type of a variable (using the typeof keyword).
Operators allows us to compute data in a programming language.
In order for an operator to work it needs two operands.
4 + 5 = 9 Here, 4 and 5 are the two operands and + is the operator.
The Assignment assigns values from the right side operand to the left side operand.
+= (Add & Assignment) : adds the right operand to the left operand and assigns the result to the left operand.
-= (Subtract & Assignment) : subtract the right operand to the left operand and assigns the result to the left operand.
*= (Multiple & Assignment) : Multiples the right operand to the left operand and assigns the result to the left operand.
/= (Division & Assignment) : Divides the right operand to the left operand and assigns the result to the left operand.
%= (Modulus & Assignment) : Modulus operation happens from right operand to left operand and assigns the result to the left operand.
The Ternary operator first checks the expressions for a true or false value and then executes the given statements.
Part 2 coming soon
Thank you for reading.
About the Author
Hello! My name is Abhishek Luv and I am an online trainer for C# & ASP.NET MVC from Mumbai, India. I provide my online training services in India and overseas. I have successfully done a lot of online training for clients from USA (Chicago, Pennsylvania, Texas, Oklahoma, Seattle, Florida, Michigan), Dubai, UK(Wales, London, Birmingham), Ireland(Dublin), Panama City, Colombia(Bogota), Denmark(Hjørring), Afghanistan, Switzerland(Zurich), Sri Lanka(Colombo), New Zealand, India(Hyderabad, Mumbai, Bangalore, Delhi, Faridabad, Kolkata, Chennai, Madurai, Gujarat).