I am running an asynchronism in js with es6 but when implementing it the browser in the console I get an error like the following:
TypeError: (0 , _translate2.default) is not a function(…)
why is this error because it appears?
I am running an asynchronism in js with es6 but when implementing it the browser in the console I get an error like the following:
TypeError: (0 , _translate2.default) is not a function(…)
why is this error because it appears?
As you can read in the Mozilla Developers Network , this was created to indicate that the type of object you return is not what was expected, in your case, you were possibly programming a closure without returning a function.
for example:
var sumar= (function () {
var suma = 0;
return function () {return suma+= 1;}
})();
sumar();
and to give you the error:
var sumar= (function () {
var suma = 0;
var hola = function () {return suma+= 1;}
})();
sumar();