How to debug identical strings that do not equal in google app script?

  1. Check type of each variable

    typeof string1 === typeof string2
    
  2. Check length of each string

    string1.length === string2.length
    
  3. Loop through each character:

    [...string1].every((char,i) => char === string2[i] || console.info(`Unequal character at ${i}`))
    
  4. Check unicode of each character:

    console.log([...string1].map((char,i) => [char, char.codePointAt(0),string2.codePointAt(i)]))
    

Leave a Comment