Skip to content

Instantly share code, notes, and snippets.

@realgio95
Last active March 3, 2018 16:05
Show Gist options
  • Save realgio95/db411c6148cb15d969e87b928de5af1f to your computer and use it in GitHub Desktop.
Save realgio95/db411c6148cb15d969e87b928de5af1f to your computer and use it in GitHub Desktop.

Revisions

  1. realgio95 revised this gist Mar 3, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ReverseString.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    /*
    Sign up for YaadCode - Live FreeCode Coamp Coding Sessions Twice Weekly on Skype
    Sign up for YaadCode - Live FreeCode Camp Coding Sessions Twice Weekly on Skype
    You may join the FreeCodeCamp, Kingston Group here: https://www.facebook.com/groups/free.code.camp.kingston.jamaica/
    https://www.freecodecamp.org/challenges/reverse-a-string
    */
  2. realgio95 revised this gist Mar 3, 2018. 1 changed file with 0 additions and 16 deletions.
    16 changes: 0 additions & 16 deletions factorialize.js
    Original file line number Diff line number Diff line change
    @@ -1,16 +0,0 @@
    /*
    Sign up for YaadCode - Live FreeCode Coamp Codding Sessions Twice Weekly on Skype
    You may join the FreeCodeCamp, Kingston Group here: https://www.facebook.com/groups/free.code.camp.kingston.jamaica/
    https://www.freecodecamp.org/challenges/factorialize-a-number
    */

    function factorialize(num) {
    if (num ==1 ){
    return 1;
    }
    if (num ==0) {
    return 1;
    }
    return num * factorialize(num-1);
    }
    factorialize(5); //Expected Output: 120
  3. realgio95 created this gist Mar 3, 2018.
    13 changes: 13 additions & 0 deletions ReverseString.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    /*
    Sign up for YaadCode - Live FreeCode Coamp Coding Sessions Twice Weekly on Skype
    You may join the FreeCodeCamp, Kingston Group here: https://www.facebook.com/groups/free.code.camp.kingston.jamaica/
    https://www.freecodecamp.org/challenges/reverse-a-string
    */
    function reverseString(str) {
    var chars = str.split("");
    chars.reverse();
    newStr = chars.join("");
    return newStr;
    }

    reverseString("hello"); //Expected Output: "olleh"
    16 changes: 16 additions & 0 deletions factorialize.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    /*
    Sign up for YaadCode - Live FreeCode Coamp Codding Sessions Twice Weekly on Skype
    You may join the FreeCodeCamp, Kingston Group here: https://www.facebook.com/groups/free.code.camp.kingston.jamaica/
    https://www.freecodecamp.org/challenges/factorialize-a-number
    */

    function factorialize(num) {
    if (num ==1 ){
    return 1;
    }
    if (num ==0) {
    return 1;
    }
    return num * factorialize(num-1);
    }
    factorialize(5); //Expected Output: 120