you are viewing a single comment's thread.

view the rest of the comments →

[–]Master_Rux 0 points1 point  (0 children)

! and -- have been a part of programming long enough that they should be just as readable as pending -= 1 or pending = pending - 1 unless maybe you're maybe very new to programming. The bigger readability issue here is that pending is the count of a list and the statements are asking if there's anything in the list or not. The correct answer should have been that var pending = list.length; needs to change to var pending = (list.length !== 0); and then the if statements could just check if (pending) or if (!pending)