Skip to content

Instantly share code, notes, and snippets.

View nrum's full-sized avatar

Dylan sanders nrum

  • Seattle, WA
View GitHub Profile
@getify
getify / 1.js
Last active December 6, 2017 14:07
comparing single recursion vs binary recursion
function reverseStr(str) {
if (str.length <= 1) return str;
var firstChar = str[0];
var restStr = str.substr(1);
return (restStr.length > 1 ? reverseStr(restStr) : restStr) +
firstChar;
}