Hi All, Is anyone using Lodash libary? I have a re...
# suitescript
s
Hi All, Is anyone using Lodash libary? I have a requirement and I am trying to find a solution for it. Can anyone help me with it? For Eg: I have Two array var arr=[43,897,321,434];var arr1=[897,23,43,4234] I need to compare both the array and return only unquie values from arr1! Thanks in advance
n
var arr2 = []; for(var i = 0; i<arr.length; i++) { if(arr1.indexOf(arr[i])) { arr2.push(arr[i]); } }
This should do it for you and arr2 should have all the values of a rr that are not in arr1.