Good, I have a doubt and I can not find an answer anywhere. The fact is that I have in a script a loop for
in which I have a condition with a break
statement. What I would like to know is if there is any way of knowing if the break
sentence has been executed or not, without using auxiliary variables or logical variables.
This is the example:
var array = [];
var variable;
for (var i=0;i<array.length;i++) {
if (array[i] === variable) {
variable = i;
break;
}
}
Is there any way to evaluate if the break statement has been executed in this code? Does it return a Boolean value in any way?