Created
March 21, 2021 02:18
-
-
Save Uzwername/0e06f4d1228405ed64f5af0c3040fd88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mirrorNumbersUpTo = (num) => { | |
console.log(num); | |
if (num > 0) { | |
mirrorNumbersUpTo(num - 1); | |
console.log(num); | |
} | |
}; | |
mirrorNumbersUpTo(5); // ➡️ logs 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment