typescript array indexes that have a value (filter empty | undefined) by Peter on 25th July 2022 in code, typescript • 0 Comments data.map((e, i) => (e ? i : -1)).filter((e) => e >= 0) Share this:TwitterFacebookEmailPrintMoreLinkedInRedditTumblrPinterest