I have this piece of script in .js file:
for (var i = 0; i <= obj.length - 1; i++) {
var result = obj[i].end_time;
if (result == null) {
var displayProcessExpectedTotaltime = '';
}
else {
var displayProcessExpectedTotaltime = '<b>Time: ' + '3/11/2014 6:00PM</b>';
}
}
it loops 8 times. What I'm trying to do here is if I even get one null result based on loop, I want to display displayProcessExpectedTotaltime as space. otherwise, if all has value means result is not null then i want to display Time.
But everytime it takes the last for-loop value. So how can I achieve it?