223k views
3 votes
5. What would the browser display if the following code were executed in a script?a var product = 0; while ( product <= 25 ); product = 2 + product; a) nothing, the script would result in an inifite-loop error b) 0 c) 25 d) 26

User StXh
by
7.3k points

1 Answer

4 votes

Answer:

An infinite-loop

Step-by-step explanation:

This is because the condition is always true ie: product is always less than 25. And once there is no sentinel to stop the loop it will run forever.

User Max Vyaznikov
by
6.7k points