java script
java script
What is JavaScript?
way of output:
1. Console.log();
2. Alert();
Way to input:
prompt()
Ex.
Variable Rules:
1.Arithmetic Operators: +, -, *, /
2.Assignment Operators: +=, -=, *=, %=, *=.
3.Comparison Operators: Equal to == .Not equal to != >, >=, <,
<= Equal to & type Not equal to & type === !==
4. Logical OR : ||
5. Logical not: !
Conditional Statements:
1. if statement.
2. else statement.
3. If-else statement.
Loops in js:
1. for Loop:
2. while Loop:
while (condition)
{ // do some work }
3. Do-while loop:
do
{ // do some work }
while (condition).
4. for-of Loop :
Ex.strvar=[12,34,23,12,34];
5. for-in Loop:
Strings in JS:
Create String :
let str = “Apna College“;
String Interpolation :
1. str.toUpperCase( )
2. str.toLowerCase( )
7. str.charAt( idx )
Java script notes
Arrays in JS:
Collections of items Create Array
Array Methods:
Functions in JS: