DD2480-G9 / metrics-graphics

A library optimized for concise and principled data graphics and layouts.
http://metricsgraphicsjs.org
Mozilla Public License 2.0
0 stars 0 forks source link

Requirement: use default parameter values #9

Closed BK239 closed 6 years ago

BK239 commented 6 years ago

Use default parameters, instead of checking if they're undefined. For example: Instead of:

function (x) {
       if (x === undefined)
              return 7;
       return x;
}

do this:

function (x=7) {
        return x;
}

See http://es6-features.org/#DefaultParameterValues for an explanation. Keep in mind this is one of the more difficult ones since it requires more knowledge about a function's use cases.

RickardBjorklund commented 6 years ago

No longer needed since assignment 3 is done!