我知道使用"===“比较类型,所以运行下面的代码会导致”不相等“,因为它是将数字类型与字符串类型进行比较。alert("They are equal"); alert("They are not equal");但我不明白如何使用"==“来比较”它们是相等的“消息中的值。= b) {
alert("They are equal"
当我尝试比较不同的数字时,数字会发生变化,但文本部分保持不变。这只发生在较大/较小的情况下,而不会发生在NaN或equal case中。下面是我的代码:function check() { var b = document.getElementById<title>Check the value of a number