Beginner
Allow Only Two Choices
The function turn accepts any text, so turn("up") is allowed. Change the parameter type so that only "left" and "right" are accepted.
Keep the function body as it is.
What Check tests
- Your code has no type errors
- The console prints
Turning left turn("up")is rejectedturn("right")is accepted
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Press Run to see the page.
Console
Nothing printed yet.