📌  相关文章
📜  javascript 将数字与字符串进行比较 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:07.152000             🧑  作者: Mango

代码示例1
let string = "1";
let number = 1;
if (parseInt(string) === number){
      // STRING AND NUMBER MATCHES
}
if (string == number){
  // STRING AND NUMBER MATCHES ALSO BECAUSE == instead of ===, means it won't compare datasets, only the content
}