Ad
Code
Diff
  • function removeEveryThird(str) {
      return (str[0] || '') + str
        .slice(1)
        .replace(/(..)./g, '$1')
    }
    • function removeEveryThird(str) {
    • return str
    • .split('')
    • .filter((x, i) => i === 0 || i % 3)
    • .join('')
    • return (str[0] || '') + str
    • .slice(1)
    • .replace(/(..)./g, '$1')
    • }