javascript finctions code example
Example 1: declaration fonction javascript
function carré(nombre) {
return nombre * nombre;
}
Example 2: How to create a function in javascript
function addfunc(a, b) {
return a + b;
// standard long function
}
addfunc = (a, b) => { return a + b; }
// cleaner faster way creating functions!