I'm going over some array problems on Leetcode and when I tried to submit my answer I got an empty result as my answer. I'm not sure why it's happing. I tried to run this function in Chrome DevTools and it works as expected. Any hints would be appreciated.
/**
* @param {number[]} nums
* @return {number}
*/
function removeDuplicates(nums) {
return nums.filter((n, index) => nums[index] != nums[++index])
}
Link to the problem: https://leetcode.com/explore/interview/card/top-interview-questions-easy/92/array/727/


