배열 탐색 함수들의 차이

Posted by Seongkyun Yu on 2020-03-24
Estimated Reading Time 1 Minutes
Words 54 In Total
Viewed Times

차이점

구분 indexOf includes find findIndex
특정 요소 탐색 O O X X
특정 조건 탐색 X X O O
배열 속 객체의 특정 프로퍼티 비교 X X O O
탐색실패시 -1 false undefined -1



구분 filter find
특정 조건 탐색 O O
전체 탐색(무조건) O X
반환값 배열 요소
탐색실패시 빈배열 undefined

If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !