我正在尝试使用 JavaScript 从 HTML 表中过滤数据,它正在做一些几乎难以弄清楚的事情。字符串比较失败。我也尝试不比较黑白原始和对象(附加屏幕截图中的监视值)我尝试跟随,并且在这些表达式中 Left Hand Side < Right Hand Side (localeCompare also returned -1 ) ... am我错过了什么?
condition = $(this).text().replace(/^\s\s*/, '').replace(/\s\s*$/, '').toString() == columnName.toString(); //false
condition = $(this).text() == columnName; //false
condition = $(this).text().replace(/^\s\s*/, '').replace(/\s\s*$/, '') == columnName.toString(); // false
condition = $(this).text().replace(/^\s\s*/, '').replace(/\s\s*$/, '').toLocaleString().localeCompare(columnName.toLocaleString()); // -1