What is this error in console with javascript?

0

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?

    
asked by TefaSmile 19.07.2016 в 18:16
source

1 answer

1

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();
    
answered by 19.07.2016 в 18:27