📌  相关文章
📜  如何检查字符串是否在字符串中 js - Javascript 代码示例

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

代码示例4
let eventValue = event.target.value;

    if (/^\d+$/.test(eventValue)) {
      eventValue = parseInt(eventValue, 10);
    }

//If value is a string, it converts to integer. 

//Otherwise it remains integer.