Skip to content

Handy javascript snippets

  • function bar(x =2, ...args

    ) : …args makes an array of all the rest of the arguments of the function

  • function bar() {
     return foo(...[2,5])
    }

    ) : … args spreads the array as individual parameters

Published inJS

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *