function expression vs function declaration
const functionExpression = function(width, height) {
return width * height;
};
console.log(functionExpression(3, 4));
// Result = 12
function functionDeclaration(width,height){
return width * height;
};
console.log(functionDeclaration(3,4));
//Result = 12
const getRectArea = function(width, height) {
return width * height;
};
console.log(getRectArea(3, 4));
// expected output: 12
const plantNeedsWater = function(day){
if (day === 'Wednesday'){
return true;
} else{
return false;
}
}
console.log(plantNeedsWater('Tuesday'))
Also in JavaScript:
- what is jsonwebtoken
- deploy create react app pm2
- post fetch call
- append before parent jquery
- change favicon with javascript
- crucer in js
- react function exec when button is clicked
- how to put firebase config in a sperate file react native
- select class with data attribute jquery
- define a while loop in node js
- js new array from new set
- multiple conditions for JavaScript .includes() method
- pdfjs customizing viewer.html js event handler
- diff two arrays javascript
- pull out only text from element javascript
- drawer navigation set width react native
- js numbers
- the red validation class doesn't apply on jquery
- jquery loop through each child element
- js extract image from mp4
- clear input field jquery
- paper material ui improt
- reduce method in javascript array of bjects
- nodejs fs delete non empty directory