I have been experimenting with the Number.isInteger() method on the Chrome console. After running a for loop and checking the result using console.log(arr);
, I noticed that the array only contains a single value of 1, like this: [1];
var arr = [1, 2, 3, 'some', 'string'];
for (var i = 0; i < arr.length; i++) {
if (Number.isInteger(arr[i])) {
arr.splice(arr.indexOf(arr[i], 1));
}
}
Does anyone have any insight into what I might be doing wrong? Any help would be greatly appreciated. Thank you!