📌  相关文章
📜  js 开头 - Javascript 代码示例

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

代码示例3
//checks if a string starts with a word
function startsWith(str, word) {
    return str.lastIndexOf(word, 0) === 0;
}
startsWith("Welcome to earth.","Welcome"); //true