Comment

Comment by bsimpson

Default parameter values, ...rest expressions, and modules were all part of ActionScript 3, which was an early implementation of JavaScript Next (then called ECMAScript 4). As I recall, Microsoft and Yahoo! threw a fit about it, and most of the interesting enhancements were shelved.

Glad to see some of the good bits making their way back in. The number of times I've had to do

    function(firstParam, secondParam, thirdParam) {
        if (firstParam.hasOwnProperty('firstParam') {
            var argumentDict = firstParam;
            firstParam = argumentDict['firstParam'];
            secondParam = argumentDict['secondParam'];
            thirdParam = argumentDict['thirdParam'];
        }
        
        firstParam = firstParam || "default value";
        ...
is sickening.
parent bsimpson 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton