The Launch Sequence

Medium+25 XP

Mission Briefing

Mission Control requires a manual override for the rocket sequence. You must program the countdown module to fire backwards from a dynamic starting point.

The Concept: Backwards Loops

Loops don't just go up! To go backwards, you set your initialization to a high number, check that it stays above a minimum, and use i-- to decrement instead of increment.

The Objective

Your function receives a number start.

  1. Use a loop to build a countdown string from start down to 1.
  2. Separate the numbers with dashes (-).
  3. For example, if start is 5, return "5-4-3-2-1". Do not include a trailing dash.

Constraints

    CoreLoopsStrings
    JavaScript
    Loading...
    3 Hidden

    Input Arguments

    start5

    Expected Output

    5-4-3-2-1

    Click RUN to test your solution