Removing Duplicates from an Array

I’ve just begun my LeetCode journey (I’m late to hop on this bandwagon because I don’t like to feel like a follower). As many beginners and job-hunters, I’m starting with the “Top Interview Questions,” and I was already challenged. My former self would take to Google to try and find answers, but I decided to stick with it and fly solo (I’m no chump and I deserve a win!).

I wrote the code just as I thought I should. First, I wrote a for loop to iterate through each index of this sorted array. I was tempted to flex some of my ES6 muscles with a for of loop, but I soon…