Skip to content

Instantly share code, notes, and snippets.

@Hacking-NASSA-with-HTML
Last active December 18, 2022 18:31

Revisions

  1. Hacking-NASSA-with-HTML renamed this gist Dec 18, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion script.js → reverseOrderOfCharacters.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    // function to reverse the order on characters in a word:
    // function to reverse the order of characters in a word:
    function reverse(word) {
    let reversedWord = ''
    for (let i = word.length - 1; i >= 0; i--) {
  2. Hacking-NASSA-with-HTML created this gist Dec 18, 2022.
    9 changes: 9 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    // function to reverse the order on characters in a word:
    function reverse(word) {
    let reversedWord = ''
    for (let i = word.length - 1; i >= 0; i--) {
    reversedWord = reversedWord.concat(word[i])
    }
    return reversedWord
    }
    console.log(reverse('word')) // prints drow