Ad

I would rather use arrow function

Code
Diff
  • const removeEveryThird = (str) => {
      return (str[0] || '') + str
        .slice(1)
        .replace(/(..)./g, '$1')
    }
    • function removeEveryThird(str) {
    • const removeEveryThird = (str) => {
    • return (str[0] || '') + str
    • .slice(1)
    • .replace(/(..)./g, '$1')
    • }