2018-03-24 16:22:20 +05:30

18 lines
304 B
JavaScript

var f0 = function (a, b = a, c = b) {
return [a, b, c];
};
expect(f0(1)).toEqual([1, 1, 1]);
var f1 = function ({a}, b = a, c = b) {
return [a, b, c];
};
expect(f1({a: 1})).toEqual([1, 1, 1]);
var f2 = function ({a}, b = a, c = a) {
return [a, b, c];
};
expect(f2({a: 1})).toEqual([1, 1, 1]);