Ecmascript daily

How to code JS better daily

Wednesday, 25 May 2016

set of ES2015 functions aimed to make functional JavaScript more idiomatic


gist link
Posted by easdasdsa at 06:41 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: es2015, functions, gist

Sunday, 22 May 2016

mandatory parameters via parameter default values

  function mandatory() {
        throw new Error('Missing parameter');
    }
    function foo(mustBeProvided = mandatory()) {
        return mustBeProvided;
    }

From: http://www.2ality.com/2016/05/six-nifty-es6-tricks.html
Posted by easdasdsa at 10:53 No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: default-parameter, es2015, functions
Home
Subscribe to: Comments (Atom)

Tags

es2015 functions default-parameter gist
Simple theme. Powered by Blogger.