Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Welcome to the Race-Day Call

This course is about how JavaScript makes decisions: else if chains, combined conditions, the conditional operator, and switch. Your project is to port the Python script a sailing club member wrote to post Saturday’s race-day call.

Here’s a first taste, on a blustery morning with 25 knots of wind, gusting 28. The club races from 6 knots up to, but not including, 25. This Python code checks the club’s wind range:

Language: Python
wind_knots = 25

if 6 <= wind_knots < 25:
    print("racing (good racing wind)")
elif wind_knots < 6:
    print("postponed (too little wind)")
else:
    print("postponed (too much wind)")

Python posts the right call:

Language: Program Output
postponed (too much wind)

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.