Closed BK239 closed 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.
No longer needed since assignment 3 is done!
Use default parameters, instead of checking if they're undefined. For example: Instead of:
do this:
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.