Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
How can I keep the values from Array1 when they don't exist in array2 using GAS?

The other posts I've seen deals with 1D Arrays, so...

Array1

[
 ["PE","151"],
 ["PE","160"],
 ["PE","188"]
]

Array 2

[
 ["PE","193"],
 ["PE","173"],
 ["PE","188"]
]

Expected Result

[
 ["PE","151"],
 ["PE","160"]
]

I've tried using filter, but I'm not sure I can get the element to compare.

const newItems = Array1.filter(el => Array2[1].indexOf(el[1]) === -1)

Thanks!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!