Debugging in ICE: The Yellow Triangle

Unlike a red X, a yellow triangle showing up to the left of your code is not a show-stopper. Your code will probably run even if lines in your code are marked with yellow triangles, but it may not run correctly. It is best to get rid of those triangles as they come up.

Let’s put this in action by writing some more bad JavaScript (but not too bad). First, remove the badjavascript line from the previous section, and add the following lines:

 
food;
 
eat(food);

In this case, ICE will tell us via the yellow triangle that the food line is not doing anything.

images/console_for_fun_and_fixing/food_unassigned.png

We can fix the problem by changing the food line into ...

Get 3D Game Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.