I know there's a simple solution but my js knowledge is VERY limited. I need to grab an attribute's value ( @{spell-fail} ) from within the scope of getAttrs in order to do something in a "parent" function. How can I use the currSpellFail variable outside of getAttrs scope? TIA example function doSomething(){
var currSpellFail
function getCurrentSpellFail(value) {
getAttrs(["spell-fail"], function(v) {
var currSpellFail = parseInt(v["spell-fail"], 10) || 0;
return currSpellFail;
});
}
// I need to do something with spell-fail out
}