• notice
  • Congratulations on the launch of the Sought Tech site

Apps Script: Return array items

Well...I think I'd better ask for some help on this one:

const name=“alain”;
const arr=["[email protected]", "[email protected]", "[email protected] ", "[email protected]"];

All I want to do is: search for email addresses that start with “alain” and pass that email address back to me as a variable, I It can be used in other functions.

Do you know how to implement it?

Thanks:)

uj5u.com enthusiastic netizens replied:

const address=arr.find(element=> element. startsWith(name))

Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+