Skip to content

Instantly share code, notes, and snippets.

@Midoukh
Created January 6, 2021 22:13
Show Gist options
  • Select an option

  • Save Midoukh/f6ee7e3a86de41e607af381f29476201 to your computer and use it in GitHub Desktop.

Select an option

Save Midoukh/f6ee7e3a86de41e607af381f29476201 to your computer and use it in GitHub Desktop.

Revisions

  1. Midoukh created this gist Jan 6, 2021.
    8 changes: 8 additions & 0 deletions reverse5.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    //the reduceRight method
    function reverseString5(str){
    return [...str].reduceRight((acc, cur)=> {
    acc += cur
    return acc
    }, '')

    }