| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith | [Back] [Original] |
Get to know MDN better
const str = "Saturday night plans";
console.log(str.startsWith("Sat"));
// : true
console.log(str.startsWith("Sat", 3));
// : false
startsWith(searchString)
startsWith(searchString, position)
searchStringposition searchString searchString 0
searchString true false
const str = "To be, or not to be, that is the question.";
console.log(str.startsWith("To be")); // true
console.log(str.startsWith("not to be")); // false
console.log(str.startsWith("not to be", 10)); // true
| ECMAScript 2027 LanguageSpecification # sec-string.prototype.startswith |
Stringanchor()at()big()blink()bold()charAt()charCodeAt()codePointAt()concat()endsWith()fixed()fontcolor()fontsize()includes()indexOf()isWellFormed()italics()lastIndexOf()link()localeCompare()match()matchAll()normalize()padEnd()padStart()repeat()replace()replaceAll()search()slice()small()split()startsWith()strike()sub()substr()substring()sup()toLocaleLowerCase()toLocaleUpperCase()toLowerCase()toString()toUpperCase()toWellFormed()trim()trimEnd()trimStart()valueOf()[Symbol.iterator]()Object/Function| Web Proxy Viewer | New URL | Original Page |