UI/Javascript

[indexof] => true & false

Soo_Parkle 2023. 12. 16. 10:05

(찾고자 하는 대상).indexof((찾고자하는 정보)

=> 있으면 return 0

=>없으면 return -1

mdn

 

 

indexof 와 include

크게 indexof는 몇번째 자리까지 알려준다.

 

 

 

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf

저작자표시 비영리 변경금지 (새창열림)