get items of array that are not in another array code example

Example 1: get element of an array inside another array

let array=[[1,2,3],
           ["apple","mango","grapes"],
           [true true false]]
//to get apple =====  arrayName[class][subclass]
console.log(array[1][0])

Example 2: find new values in array based on another array apps script

const ObjectOfKeys = keys.reduce((acc,rec)=> {
                        let nextAcc = acc;
                        nextAcc[rec] = true;
                        return nextAcc;
                        },{}};

const filteredData = data.filter(rec => !ObjectOfKeys[rec[0]])

Tags:

Misc Example