Here's what I have:
function verificarNumero(test, num) {
return (test(num));
};
var resultadoTesteMultiplos = verificarNumero(function (num){return (num % 10 == 0);}, num1);
This function is supposed to find out if a number is a multiple of 10. I know there are simpler ways to do it, but I really want to make this work.
I want to be able to do something like console.log(resultadoTesteMultiplos(10)); but the console returns "resultadoTesteMultiplos is not a function", and "num1 is undefined."
What am I doing wrong?
num1?undefinedwhen the function you are passing it to receives it (and you haven't declared it either, so you'll get a ReferenceError for that).