Reputation: 6144
I can not solve this case - linter points me to other solution. This is my original code:
if (arguments[0] && typeof arguments[0] === 'object') {
this.options = extendDefaultProperties(defaultProperties, arguments[0]);
}
Any help? Thank you in advance.
Upvotes: 23
Views: 27194
Reputation: 192317
Use the rest parameters to collect the params into the array args
:
demo(...args) {
if (typeof args[0] === 'object' && args[0] !== null) {
this.options = extendDefaultProperties(defaultProperties, args[0]);
}
}
Upvotes: 24