bar: function () {
var cValue = false;
car(4, function () {
cValue = true;
if (cValue)
alert("cvalue is true 1");
});
if (cValue)
alert("cvalue is true 2");
}
car: function (val, fn) {
fn();
}
I have encountered a similar issue in my code and I am unable to trigger the second alert. Can you spot any potential problems in the code provided above?