google script load single column to array code example

Example 1: 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 => !ObjectKeys[rec[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