javascript editor not executing propery

Tried in chrome and safari. Wasted a lot of time on this and would like a refund. This code works in my editor and the browser consoles.

var removeDuplicates = function (nums) {
   if(!nums.length) return [];
   let uniqueValues = [nums[0]];


   for (let i=1; i<nums.length; i++){
       if(uniqueValues.indexOf(nums[i]) === -1){
           uniqueValues.push(nums[i]);
       }
   }

   return uniqueValues;
};

image
image

Comments (0)