Check whether '.' and '/' are escaped properly
What about, instead of search for every . and / and check the predecessor character, you write a regexp that find a . and / that don't have \\ before?
This way, you can avoid the loop and the short circuit to an array


function isValidEscaped(str) {
  const pattern = /[^\\]{2}[./]/g;
  return str.search(pattern) === -1; 
}