Skip to content

Instantly share code, notes, and snippets.

@utgarda
Forked from Chris927/reverse.coffee
Created March 22, 2012 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utgarda/2158025 to your computer and use it in GitHub Desktop.
Save utgarda/2158025 to your computer and use it in GitHub Desktop.
Reverse a string in CoffeeScript
reverse = (s) ->
if s.length < 2 then s else reverse(s[1..-1]) + s[0]
s = "Hello"
console.log "s=#{s}, s.reverse=#{reverse(s)}"
@kannnannmk
Copy link

np5q49815q3496psr7207noppr23n244
p0477p71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment