Tres formas de escribir una función en JavaScript
//Three ways of writing a function in javascript
//1 Function declaration
function add(a, b) {
console.log(a + b);
}
// Calling it
add(2, 3);
//2 Function Expression
const add = function(a, b) {
console.log(a+b);
}
// Calling it
add(2, 3);
//3 Arrow function (for Single line of code)
let add = (a, b) => a + b; //inbuilt return
console.log(add(3, 2));
harsh Upadhayay