-2
I started studying Js recently and I am in doubt between the use of function
and Function
.
-2
I started studying Js recently and I am in doubt between the use of function
and Function
.
2
function
is a Javascript keyword used to define a new function, already the Function
references the class. Javascript functions are first class objects, each function you create is a new object.
function soma(a, b) {
return a + b;
}
const somaPorInstanciacao = new Function("a", "b", `
return a + b;
`);
console.log(soma(1, 2));
console.log(somaPorInstanciacao(1, 2));
Browser other questions tagged javascript function
You are not signed in. Login or sign up in order to post.
In what context? Edit your question and give more details.
– Luiz Felipe