본문 바로가기

ES6

find() - includes()

반응형

item.includes()

제공되는 테스트 조건을 만족하는 첫번째 엘레먼트 값을 리턴하는 함수

 

 

See the Pen temp01 by hwd3004 (@hwd3004) on CodePen.

 

콘솔창을 확인해보면

"aaa@naver.com"

확인 가능

 

 

 

 

 

See the Pen temp02 by hwd3004 (@hwd3004) on CodePen.

 

item.includes() 를 써서 gmail을 찾아봄.

includes 는 string을 찾아줌

콘솔창을 확인해보면

"bbb@gmail.com"

확인 가능

 

반응형

'ES6' 카테고리의 다른 글

forEach(), map()  (0) 2020.09.14
filter() - includes()  (0) 2020.09.14
arrow function을 사용하지 않아야할 때. 'this'  (0) 2020.09.09
arrow function  (0) 2020.09.09
block scope  (0) 2020.09.09