This is an odd one! I kind of want to say the reason my replace function isn't working correctly is because of the font. I've never seen this issue before, and I wonder if I'm overlooking something!?
I have the following variable set to a static text with '.
var lastName = "O'Donnell";
In my browser, console.log(lastName) outputs: O’Donnell. Instead of O'Donnell. Therefore, the following replace method isn't working.
return lastName.replace(/'/g, '')
What am I doing wrong?

'character, it's actually a "smart quote" character. It's unicode point isU+2019. You can try to use the regex/\u2019/g.'character. He must the smart quote in his code (if you copy and paste from MS word, it sometimes does this). Also, those characters don't always stay when copying and pasting into other programs or as plain text.'. My local dev site displays a different text than the client's dev site. Even though, the source code is the same.