Do not access out of bounds arguments (#6792)
Potentially out of bounds arguments should not just be directly accessed, instead use a ternary operator to check length.
This commit is contained in:
committed by
Nicolò Ribaudo
parent
e67cfc5b31
commit
2b710d0387
@@ -5,6 +5,6 @@ var some = function () {
|
||||
|
||||
var collect = function () {
|
||||
let since = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
||||
let userid = arguments[1];
|
||||
let userid = arguments.length > 1 ? arguments[1] : undefined;
|
||||
console.log(userid);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user