I check the response from the server, where the string surname
comes from in the variable data
. As a result, I have a very strange picture:
console.log(typeof(data)) // string console.log(data) // surname var f = (data === "surname"); console.log(f) // false;
Save How to find a bug?
var data = "surnаme";
- here the letter "a" is Cyrillic. And in all your checks in Latin. - Sergiksconsole.log( data.split("").reduce(function(p,c){p.push( c.charCodeAt(0).toString(16)); return p;}, []).join(':'));
- will output the hexadecimal codes of each of the characters of the line through a colon:73:75:72:6e:61:6d:65
- Sergiks