Everything In Javascript is Object !
Todays Topics : Basic Operation, Operator , Conditional Statement,
Window Object functions
- prompt()
- Confirm()
- alert()
- console.log/warn/error()
Basic Operation
Code Runner Extension for run terminal ans in JS File , An Play Button will appear
In AND Operator , we need all comdiation needs to be true,to be true ,
In OR Operator , we need any One must be true to be True , else false,
SYMBOLS = AND &&, OR || , NOT !
Welcome to Node.js v25.0.0.
Type ".help" for more information.
> "13"+45
'1345'
> 12+23
35
> 78==45
false
> 78==78
true
> 78==="78"
false
> 4==4 && 5>4
true
> 5==5 && 6>1 && 6<2
false
> 45==44 || 32<45
true
> 2!=3 && 5==7 && 9>2
false
> 9==="9" || 3>1
true
> !(4>10 || 7==7)
false
>
This is JavaScript File
// let Age = prompt("Enter A Number :");
// alert(Age);
// alert(typeof Age);
let a = 12;
let b = 34;
document.writeln("Addition is: ", a+b);
document.writeln("Subtraction is: ", a-b);
document.writeln("Multiplication is: ", a*b);
document.writeln("Division is: ", a/b);
var length = 5;
var breath = 3;
const radius = 6;
document.writeln("Area of Reactangle :" , length*breath);
let area = Math.PI * radius * radius;
document.writeln("Area of circle: " + area);
// Conditions
let age = 18;
if (age => 18) {
document.writeln("You Are 18 Year old !");
} else {
document.writeln("You are Not 18 Year Old !");
}
// check of even or odd Number
let n = 2;
if (n%2==0) {
console.log("It is even Number !");
} else {
console.log("It is Odd Number");
}
This is js output !