// Expressions in js
// A simple function without any expression
function func() {
console.log("Hello i am a function");
}
func();
// A fancy function in js with expression is like shown below
const func_2 = function () {
console.log("Hello i am a function");
}
func_2();
const plantNeedsWater = function(day){
if (day === 'Wednesday'){
return true;
} else{
return false;
}
}
console.log(plantNeedsWater('Tuesday'))
const mul = function(x, y){
return x * y;
}; //semicolon needs to be there as it is expression
console.log(mul(10, 20));
let namedFunction = function myFunction(){
//some code here...
}