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.
- Use a loop to build a countdown string from
startdown to 1. - Separate the numbers with dashes (
-). - For example, if start is 5, return "5-4-3-2-1". Do not include a trailing dash.
Constraints
CoreLoopsStrings
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
start5
Expected Output
5-4-3-2-1
Click RUN to test your solution