/*
to compare runtimes for string reversal JS functions:
 http://eddmann.com/posts/ten-ways-to-reverse-a-string-in-javascript/
basic string reversals:
https://medium.freecodecamp.com/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb#.fer9ql1zm
*/

function reverseStringBuiltin(str) {
  return str.split("").reverse().join("");
}

function reverseStringIterative(str) {
  var newString = "";
  // iterate in decrementing order, adding character at index to new array
  for (var i=str.length - 1; i >= 0; i--) {
    newString += str[i];
  }
  return newString;
}

function reverseStringRecursive(str) {
  // base case
  if (str === "") {
    return "";
  } else {
    // extract substring starting at 1 index and
    // concatenate character at 0 index
    return reverseStringRecursive(str.substr(1)) + str.charAt(0);
  }

}

@@ -124,146 +124,8 @@
 pt/%0A
-basic string reversals:%0Ahttps://medium.freecodecamp.com/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb#.fer9ql1zm%0A
 */%0A%0A
@@ -355,17 +355,19 @@
 r (var i
-=
+ = 
 str.leng
@@ -508,15 +508,21 @@
 (str
+.length
  === 
-%22%22
+1
 ) %7B%0A
@@ -532,18 +532,19 @@
  return 
-%22%22
+str
 ;%0A  %7D el
@@ -559,19 +559,14 @@
  // 
-extract sub
+slice 
 stri
@@ -675,13 +675,12 @@
 tr.s
-ubstr
+lice
 (1))
@@ -689,18 +689,11 @@
  str
-.charAt(0)
+%5B0%5D
 ;%0A  

change string extraction for recursion, change base case to not return empty string