Why are strings that look the same not equal?

has a string like this: var innerHTML = "SRC_BANK_ (select SERNO, MODEL_ID, ITEM_ID, INIT_VALUE, RE_VALUE, FIN_VALUE, GUARANTY_NO from CMIS.psp_check_info) < MainJob >"

convert it in two different ways: (the following code can be copied and run in the browser console)

//html:htmltypesecape
function escapeHtml(html,type,escape){
  var objE = document.createElement("div");
  objE.innerHTML = html;
  type 
    ? (escape 
      ? (html.includes("&") ? (objE.innerText = html) : (objE.innerText = new Option(html).innerHTML)) 
      : (html.includes("<") && (objE.innerText = html)))
    : (objE.innerHTML = objE.innerText);
  return objE.innerText;
}

var innerHTML = "SRC_BANK_( select SERNO ,MODEL_ID ,ITEM_ID ,INIT_VALUE ,RE_VALUE ,FIN_VALUE ,GUARANTY_NO from CMIS.psp_check_info)<MainJob>";

var nodeId0 = innerHTML.replace(/</,"<").replace(/>/,">").replace(//g," ");
var nodeId1 = escapeHtml(innerHTML,true);
console.log(nodeId0 == nodeId1);
console.log("nodeId0:",nodeId0,nodeId0.length);
console.log("nodeId1:",nodeId1,nodeId1.length);

however, the result is

clipboard.png

which boss can explain why they are not equal?


  

I am also surprised to copy and compare it, but the space is not the same?! NodeId [0]! = = nodeId [1]-

Menu