indexOf1 [JS] includes와 indexOf의 차이점 배열에 특정 값이 존재하는지 확인하는 코드를 작성하다 includes와 indexOf 모두 사용할 수 있어 두 개의 차이점이 궁금해졌다. 배열에 찾는 특정 값이 있다면 includes는 true, 없다면 false 반환. indexOf는 있다면 그 값의 index, 없다면 -1을 반환한다. 새로 안 사실 https://stackoverflow.com/questions/35370222/array-prototype-includes-vs-array-prototype-indexof Array.prototype.includes vs. Array.prototype.indexOf Beyond the improved readability, is there any advantage to includes over inde.. 2023. 6. 20. 이전 1 다음