2
While testing some Javascript features in learning I came across the following problem, when executing this code I could not understand why the addition function did not trigger an error and it was only declared well after being called in the code.
console.log(somar(5,5)) //<--copila
console.log(mult(5,5)) //<--nao copila
function somar(x,y){
return x +y
}
const mult = function (x,y) {
return x * y
}
So, what I did was define a const called mult and assign to it an anonymity function only that all this occurred well after calling it so the error occurred, but I did the msm with the sum function and that error n appeared, was that q n manage to understand ;s
– Reubber