Skip to content

Instantly share code, notes, and snippets.

@loschtreality
Created August 18, 2022 00:15
Show Gist options
  • Save loschtreality/4ca67e7fda9db812db8317ba97a187f1 to your computer and use it in GitHub Desktop.
Save loschtreality/4ca67e7fda9db812db8317ba97a187f1 to your computer and use it in GitHub Desktop.
// Write a function which takes in an array of elements and prints the elements in reverse to the console
function printBackwards(inputArray) {
// write your code here
}
// A few tests
console.log(printBackwards([1, 2, 3, 4, 5])) // prints "5 4 3 2 1"
console.log(printBackwards(["o", "l", "l", "e", "h"]) // prints "h e l l o"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment