function:
function subtracao(a, b) {
return a - b;
}
function somar2(a) {
return a + 2;
}
function diaDoMes() {
return new Date().getDate();
}
function superFuncao(a, b) {
let subtracao = a - b;
subtracao = subtracao - 2;
let diaDoMes = new Date().getDate();
return diaDoMes;
}
arrow funcion:
const subtracaoVersao2 = (a, b) => a - b;
const somar2Versao2 = a => a + 2;
const diaDoMesVersao2 = () => new Date().getDate();
const superFuncaoVersao2 = (a, b) => {
let subtracao = a - b;
subtracao = subtracao - 2;
let diaDoMes = new Date().getDate();
return diaDoMes;
}