skip to Main Content

Filter Segment Array from Small Segment Array – Jquery

let big_coordinates_arr =[ [1,2],[3,4],[5,8],[7,9]] ; let small_coordinates_arr=[ [3,4],[7,9] ] ; let is_same = (arr1,arr2) => arr1.length == arr2.length && arr1.every(function(element, index) { return element === arr2[index]; }); let result = big_coordinates_arr.filter(c1 => !small_coordinates_arr.some(c2 => is_same(c1,c2))) console.log(result) let big_coordinates_arr =[ [[1,2],[3,4]],…

VIEW QUESTION
Back To Top
Search