자바스크립트 두 배열에서 공통 객체 찾기 Array.prototype.some()
·
Front/javascript
아래와 같이 두개의 배열이 있을 때, 두 배열에 모두 존재하는 객체를 찾아 반환해야 하는 코드를 짜야 했었다. const a = [ {name: "jake", age: "11", school: "tes"}, {name: "luna", age: "13", school: "tes"}, {name: "leo", age: "7", school: "sin"}];const b = [ {name: "jake", age: "11", school: "tes", add: "13st"}, {name: "luna", age: "15", school: "tes", location: "downtown"}, {name: "leo", age: "7", school: "sing", city: "london"}]; 반복문을 ..