Member-only story
LINQ vs TypeScript: Method Equivalents at a Glance
How to translate your favorite C# LINQ methods into JavaScript

Not a member? Read for free here.
Introduction
After years of working as a .NET backend developer, I transitioned into frontend development with TypeScript and quickly realized something: While LINQ made working with collections in C# feel elegant and intuitive, doing the same in TypeScript wasn’t always straightforward. I often knew exactly what I wanted to do — filter, transform, group — but not how to do it in TypeScript.
This article is a practical guide for developers like me who are fluent in LINQ and want to quickly find the TypeScript equivalents of common LINQ methods. If you’re short on time, feel free to jump straight to the summary table at the end. But if you’d like to scroll through and pick up some extra tips and caveats along the way, you’re more than welcome.
This post is a follow-up to my previous article, where I shared my experience of moving from backend architecture to frontend development — what surprised me, what I missed, and what I had to relearn. This time, we’re diving straight into the code.
Select → map
C# (LINQ)
var names = people.Select(p => p.Name);
var doubled = new[] { 1, 2, 3 }.Select(n => n * 2);
TypeScript
const names = people.map(p => p.name);
const doubled = [1, 2, 3].map(n => n * 2);
Notes
Select
works on anyIEnumerable<T>
, whilemap()
only works on arrays.- In JavaScript, watch out for
null
orundefined
—callingmap()
on them throws an error. - Both methods return a new collection with the same number of items.
Where → filter
C# (LINQ)
var active = users.Where(u => u.IsActive);
TypeScript
const active = users.filter(u => u.isActive);
Notes
Where
andfilter
both return only items that match the condition.