Javascript Tagalog - String indexOf 메서드

Disclaimer: This is a Blog i made with the initial intention of reinforcing my knowledge in JS. I just thought sharing my blogs might be helpful for someone since they are written in tagalog/taglish. Incase of Misinformation I won't be responsible for it and you can comment on the blog to address the mistake or email me. I'm always trying my best to be as accurate as possible. take a look at other resources just to be sure.
Ano ngaba ang String indexOf 메서드가 Javascript입니까?
Yung indexOf 메소드 sa javascript는 hahanapin niyalang yung pinakaunang 발생 ng 문자열 na binigay mo를 인수로 사용하여 재반환 값 niya yung index nung string nayon을 반환합니다.

wala siyang nakita re-return niya가 -1인 경우

tignan niyo nalang pics if hindi niyo masyado maintindihan.

파노 가미틴:
첫 번째 인수 - yung string na gusto mong kunin yung unahan niyang index

const x = 'hello my dog name is dog'

console.log( x.indexOf('my')  ) // 6
console.log( x.indexOf('o')   ) // 4
console.log( x.indexOf('cat') ) // -1


두 번째 인수(선택 사항) - kung sang index siya mag-uumpisa mag search(기본값은 yung 시작 ng 문자열인 0임)

const x = 'hello my dog name is dog'

// Searching sa 'hello my dog name is dog'
console.log( x.indexOf('hello',0) ) // 0 

// Searching sa 'ello my dog name is dog'
console.log( x.indexOf('hello',1) ) // -1

// Searching sa 'llo my dog name is dog'
console.log( x.indexOf('llo',2) ) // 2

// Searching sa 'hello my dog name is dog'
console.log( x.indexOf('llo') ) // 2


dalawa가 sino kukunin niyang index를 발생시키면?

const x = 'hello my dog name is dog'

console.log( x.indexOf('dog') ) // 9

console.log( x.lastIndexOf('dog') ) // 21


kukunin niya yung index ng pinakaunang 발생률 9,
kung gusto mo kunin yung index ng 마지막 발생 gamitin mong 방법은 lastIndexOf


baka 지나치게 단순화되고 부정확한 정보 nasulat ko 그래서 여기에 더 자세한 문서가 있습니다(영어).
MDN Documentation - String indexOf Method
더 많은 tagalog Javascript 학습 리소스:
https://javascript-in-tagalog.netlify.app

좋은 웹페이지 즐겨찾기