DEV Community

Discussion on: Daily Challenge #243 - Redacted!

Collapse
 
dimaip profile image
Dmitri Pisarev 🇷🇺

This one can be slightly optimised to return early on failure and not go through the whole string:

const isSame = (a, b) => a.split('').every((char, index) => char === 'X' || char === b[index])