Can someone explain me why this don´t work:
var outsideVar = 15;
myFunc.doSomething().then(function() {
console.log("outsideVar: " + outsideVar);
}).fail(function(err) {
console.log("error: ", err);
});
the output is error: undefined or outsideVar: undefined (depends if outsideVar is a variable or property of an object.
An outside variable should be accessible from inside the function or i´m wrong?
EDIT: I´m using this construction with spookyjs and it seems there is an issue with objects containing very long strings.