JavaScript Fundamental Part 3
for(var i = 0; i < 4; i++) { moveForward(); if(checkHasSwitch()) { if(checkSwitchHasClosed()) { openSwitch(); } } }