UNPKG
es6-default-params
Version:
latest (0.4.3)
0.4.3
0.4.2
0.4.1
0.4.0
0.3.0
0.2.0
0.1.0
0.0.2
0.0.1
Function default parameters compiled to ES5.
github.com/square/es6-default-params
es6-default-params
/
test
/
examples
/
arity.js
6 lines
(4 loc)
•
159 B
JavaScript
View Raw
1
2
3
4
5
6
/* jshint esnext:
true
*/
assert
.equal((
function
(a)
{}).length,
1
);
assert
.equal((
function
(a=5)
{}).length,
0
);
assert
.equal((
function
(a, b, c=5)
{}).length,
2
);