removed if statement and solved issue with ternary inside of the while loop. final value pushed after exiting while loop
removed if statement and solved issue with ternary inside of the while loop. final value pushed after exiting while loop

drakenm/js-test-code,drakenm/js-test-code