JavaScript is a programming [Link] use it to give instructions to computer.
JavaScript Topic:
● Variable
● Datatype
● Operators
● Conditional statements
● Loop
● String
● Object
● Array
● Function
● Method
● Documents object model
● Events
● Classes
● Object
● Callbacks
● Promise
● Async Await
To print something in JavaScript:
[Link](“string”)
[Link](num)
★comments:
Single Line comment:
//This a JavaScript note
Multiline comments:
/*This is a JavaScript note*/
★Variable: variables are containers for data.
full_Name= “Sabbir”
age= 15
Rules for declaring variable :
● Variable variables are case sensitive ; ‘a’ &. ‘A’ is different .
● Only letter,digits, underscore(_) and $ is allowed .
● digits cannot be the first letter.
● Reserved word cannot be a variable.
To define variable:
[Link]: can be redeclared and updated.
[Link]: cannot be redeclared but can be updated.
[Link]: cannot be redeclared and updated.
Redeclared:
var a = “ name”
var a= “ full name”
[Link](a)
=>full name
updated:
var a= “name”
a=”full name”
[Link](a)
=>full name
★Datatypes:
[Link] Data types:
● number
● string
● boolean
● undefined
● null
● biglnt
● symbol
Object: collection of data.
const or let student= {
fullname: “Sabbir” ;
age: “18” ;
cgpa: “3.6” ;
Ispass: “true” ;
}
[Link](student [“Ispass”])
Or [Link]([Link])
=>true
student[“age”] =student[“age”] +25
[Link](student[“age”])
=>43
★Operator:
[Link] Operator:
+,-,*,/,%,**
[Link] Operator:
++(increament),--(decreament)
Post:
let a= 5 ;
[Link](“a=”++a);
=>a=6
Pre:
let a=5;
[Link](“a=”a++);
=>a=5
[Link](“a=”a)
=>a=6
[Link] Operator:
= , += , -= ,*= ,%= , **=
[Link] Operator:
● Equal to : ==. also type: ===
● Not Equal to : !=. also type: !==
● Getter than : >
● Getter than equal to : >=
● Not getter than: <
● Not getter than equal to: <=
let a= 6;
let b=6;
[Link](“a===b:”a===b);
=> a===b: true
[Link](“a!==b:”a!==b);
=>a!==b:false
[Link] Operator:
● Logical And : &&
● Logical OR : ||
● Logical Not : !
let a=6;
let b=7;
[Link]( a!=b && a<b);
=>true
let a=6;
let b=7:
[Link](!(a>b));
=>true
[Link] Operator :
★Conditional statement:
● If statement:
let age= 19;
If(age>18){
[Link](“you can vote”);
}
=>you can vote
let mode= “dark”
let color;
If (mode== “ dark”){
color= “ black”;
}
[Link](color)
=>black
● If-else statement :