- Local variable – It’s declared inside a variable that is an accessible block or function only.
- Global variable-It declares any outside function that has an accessible window object function.
- The Name must Start with a letter(A-Z or a-z) and use underscore(-) or dollar sign.
- After the First letter used digits (0-9
- Operators– Operator is the mathematical and logical components that perform some operation on one or multiple operants like data value and result of any kind of product.
Now we describe how an operator works in an example- When we include 2+3 here + is a sign of operation and 2 is the left side operant and 3 is the right side operant. The sign of + performs the addition of two numeric values and shows the results 5.
There are many kinds of operators like
- String Concatenation
- Arithmetic Operators
- Local Operators
- Comparison Operators
- Assignment Operators
- Ternary Operator and more.
When you press // in the font in your code all text to the right of the code will be ignored, until the next line. This is the most valuable of developers.
- Multiple Line comments- When we write huge notes of single-line comments, this is the burden of code.
This code is important because this feature can be used to debug any code to find locations that fix bugs quickly.
Conditional statements to control the value of the function and detiremine of code can run to show a return result. It used to dedicate the excursion based on different conditions.
There are mainly 3 types of condition that show below-
- If conditions- when you want to execute something based on some condition that is called if conditions.
- Else conditions- When you want the code to execute every time showing evaluates to false. Ele statement must follow if and Else if statements. Else use if you want two conditions and execute a different set of code.
- Else -if conditions- When you want to check more than two conditions then you use Else if statements code.