javascript
JAVA:-
Javascript and java are completed different language, both in concept and design.
Javascript was invented by brendan eich in 1995, and become an ECMA Standerd .
ECMA-262 is the official name of the standerd. ECMA Script is the official name of the language.
| ECMA- European Computer Manufactures Association |
JAVASCRIPT VERSIONS:-
ECMA Script versions have been abbreviated to ES1, ES2, ES3, ES5 and ES6.
Since 2016, versions are named by year (ECMA Script 2016, 2017, 2018, 2019, 2020).
JAVASCRIPT VARIABLE:-
Variables are containers for storing data (storing data values) .
In this examples X,Y and Z are variables. Declare with the var kayword.
| EXP- | var x = 5; |
| var y = 6: | |
| var z = x + y; |
4 way to declare a javascript variables.
| Using var |
| Using let |
| Using const |
| Using nothing |
JAVASCRIPT IDENTIFIRES:-
All javascript variables must be identified with unique name these unique names are called identifires.
Identifires can can be short name ( like X and Y) or more descriptive name ( age, sum, totalvalue ).
The general rules for (ontructing name for variables unoque identifires ) are-
- Name can contain letter, digit, underscore, and doller signs .
- Names must begin with a letter.
- Name can also begin with $ and Underscore. .
- Nmaes are case sensitive ( X and Y are diffenrent variables ) .
- Reserved words ( like javascript keywords ) can't be used as names.
JAVASCRIPT OPERATOR:-
There are defferent types of javascript operators -
- Arithemetic operators
- Assignment operators
- Comparison operators
- String operators
- Logical operators
- Bitwise operators
- Ternary operators
- Type operators
ARITHMETIC OPERATOR:-
| OPERATORS | DESCRIPTION |
|---|---|
| + | Addition |
| - | Substraction |
| * | Multiplication |
| ** | Exponentiation( ES2016 ) |
| / | Divison |
| % | Modulus ( Division Remainder ) |
| + + | Increment |
| - - | Decrement |
ASSIGNMENT OPERATORS:-
| OPERATORS | EXAMPLES | SAME AS |
|---|---|---|
| = | X=Y | X=Y |
| += | X+=Y | X=X+Y |
| -= | X-=Y | X=X-Y |
| *= | X*=Y | X=X*Y |
| /= | X/=Y | X=X/Y |
| %= | X%=Y | X=X%Y |
| **= | X**=Y | X=X**Y |
COPARISION OPERATORS:-
| Operator | Description |
|---|---|
| = = | Equal to |
| = = = | Equal value and Equal type |
| ! = | Not Equal |
| ! = = | Not Equal Value or Not Equal Type |
| < | Less Than |
| > | Greater Than |
| > = | Greater Than Equal to |
| < = | Less Than Equal to |
| ? | Ternary operator |
LOGICAL OPERATORS:-
| Operator | Description |
|---|---|
| & & | Logical And |
| | | | Logical Or |
| ! | Logical Not |
TYPES OF OPERATORS:-
| Operator | DescriptionM |
|---|---|
| Type of | Returns the type of a variable |
| Instance of | Return true if object is no intance of on object type |
BITWISE OPERATORS:-
Bit operators work on 32 bits numbers any numeric operand in the operator in the operation is converted into a 32 bit number, the result is converted back to a java script number.
| Operator | Description | Example | Same as | Result | Decima |
|---|---|---|---|---|---|
| & | And | 5&1 | 0101&0001 | 0001 | 1 |
| | | Or | 5|1 | 0101| 0001 | 0001 | 5 |
| ~ | Not | ~5 | ~0101 | 1010 | 10 |
| ^ | Xor | 5^1 | 0101^0001 | 0100 | 4 |
| << | Left shift | 5<<1 | 0101<<1 | 1010 | 10 |
| >> | Right shift | 5>>1 | 0101>>1 | 0010 | 2 |
| >>> | Unsigned right shift | 5>>>1 | 0101>>>1 | 0010 | 2 |
JAVASCRIPT DISPLAY POSSIBILITIES :-
Javascript can "display" data in different ways.
- Writing into on HTML element, using Inner HTML.
- Writing into the HTML uotput using Document.write( ).
- Writing into an alert box, using Window.alert( ).
- Writing into the browser console,using Console.log( ).
good work keepit up
ReplyDeleteBhai mujhe bhi sikha do blogspot banana
ReplyDeleteok
Delete