Baseline Widely available
includes()
ë©ìëë íëì 문ìì´ì´ ë¤ë¥¸ 문ìì´ì í¬í¨ëì´ ìëì§ë¥¼ íë³íê³ , 결과를 true
ëë false
ë¡ ë°íí©ëë¤. ê²ì ì ëì문ì를 구ë¶í©ëë¤.
const sentence = "The quick brown fox jumps over the lazy dog.";
const word = "fox";
console.log(
`The word "${word}" ${
sentence.includes(word) ? "is" : "is not"
} in the sentence`,
);
// Expected output: "The word "fox" is in the sentence"
구문
includes(searchString)
includes(searchString, position)
매ê°ë³ì
searchString
ì´ ë¬¸ìì´ìì ì°¾ì ë¤ë¥¸ 문ìì´. ì ê·ííìì´ ì¬ ì ììµëë¤.
position
Optional
searchString
ì 찾기 ììí ìì¹. (ê¸°ë³¸ê° 0
).
문ìì´ì ì°¾ìë´ë©´ true
. ì¤í¨íë©´ false
.
ì´ ë©ìë를 ì¬ì©í´ 문ìì´ ë´ì ì°¾ê³ ì íë ë¤ë¥¸ 문ìì´ì´ ìëì§ íì¸í ì ììµëë¤.
ëì문ì 구ë¶includes()
ë©ìëë ëì문ì를 구ë³í©ëë¤. ì를 ë¤ì´ ìë ì½ëë false
를 ë°íí©ëë¤.
"Blue Whale".includes("blue"); // returns false
ìëì ê°ì´ ì본 문ìì´ê³¼ ê²ì 문ìì´ì 모ë ì문ìë¡ ë³ííì¬ ì´ ì ì½ ì¡°ê±´ì í´ê²°í ì ììµëë¤.
"Blue Whale".toLowerCase().includes("blue"); // returns true
ìì includes()
ì¬ì©í기
const str = "To be, or not to be, that is the question.";
console.log(str.includes("To be")); // true
console.log(str.includes("question")); // true
console.log(str.includes("nonexistent")); // false
console.log(str.includes("To be", 1)); // false
console.log(str.includes("TO BE")); // false
console.log(str.includes("")); // true
ëª
ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4