javascript

JAVASCRIPT

-:-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-

  1. Name can contain letter, digit, underscore, and doller signs .
  2. Names must begin with a letter.
  3. Name can also begin with $ and Underscore. .
  4. Nmaes are case sensitive ( X and Y are diffenrent variables ) .
  5. Reserved words ( like javascript keywords ) can't be used as names.

JAVASCRIPT OPERATOR:-

There are defferent types of javascript operators -

  1. Arithemetic operators
  2. Assignment operators
  3. Comparison operators
  4. String operators
  5. Logical operators
  6. Bitwise operators
  7. Ternary operators
  8. 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.

  1. Writing into on HTML element, using Inner HTML.
  2. Writing into the HTML uotput using Document.write( ).
  3. Writing into an alert box, using Window.alert( ).
  4. Writing into the browser console,using Console.log( ).

Comments

Post a Comment

Popular posts from this blog

Python literals

Python Operators