variables, conditions, alert
JavaScript is a programming language. Hence the basic programming language constructs are also available. Using them you can create things like mathematical calculations etc.
Use let
, const
, var
to declare them.
var i = 10; //in a file everywhere accessible and can change
let j = 20; //local and can change
const k = 30; //Can't change
//without parameter
function Hi(){
return 'Hi there!!'
}
//with parameter
function SayHello(name){
return 'Hello ' + name;
}
//to call
Hi();
SayHello('Wriju');
+
-
*
/
alert('Hello')
var i = 10;
alert(i)