Filter
Exclude
Time range
-
Near
A lot of Kotlin developers use collection operations every day. But using map, filter, associate, groupBy, flatMap, or sorting functions is not the same as being able to precisely predict the result of a longer pipeline. That difference matters. When you can reason through collection processing accurately, you write better code, review code faster, and make fewer mistakes when refactoring or combining operations. When you cannot, collection chains start to feel “probably correct” rather than clearly understood. This game is designed to train that precision. Each round gives you a collection and a transformation pipeline, and your task is simple: determine the final result. No IDE help, no execution, no guessing by vibe — just Kotlin reasoning. If you enjoy practical Kotlin challenges, give it a try: marcinmoskala.com/Collection…
7
404
Rui Vieira retweeted
🚀 Kotlin Performance Tip: flatMap() vs fastFlatMap() Most Android developers use: val result = items.flatMap { it.children } But if you've explored Jetpack Compose internals, you may have noticed something different: (1/5) #androidDev #kotlindev #jetpackcompose
1
3
26
2,502
Same size in reality, they tooka flatmap with equal size squares and adjusted it to fit a sphere
7
p[2].split("Z").flatMap((c60g, h) =>c60g.split("").map((c, i) => (h > 0 && i === 0) ? Number(oe60[c]) 60:oe60[c])).join(" ") こゆこと1次配列にして最後にjoinがたぶんいいんじゃないかな
p[2].split("Z").reduce((acc, c60g, h) => acc c60g.split("").reduce((a, c, i) => `${a} ${(h > 0 && i === 0)?Number(oe60[c]) 60:oe60[c]}`, ""), "").substring(1) まぁforofの方が良いんだけども。
84
flatMapでいいじゃんね。まぁ後でね。
21
Should you replace all flatMap() calls with fastFlatMap()? Not necessarily. For most applications, the performance difference is negligible, and readability should win. The real lesson here is: ✅ Write readable code first ✅ Measure performance bottlenecks (4/5)
1
2
292
val result = items.fastFlatMap { it.children } So what's the difference? 🔹 flatMap() - Part of the Kotlin Standard Library - Works with any iterable - Creates iterators internally - Clean, readable, and suitable for most use cases (2/5)
1
1
311
Replying to @TosinOlugbenga
They are both use for transforming data. Use map() when you have a single level array and you just want to transform each item. Use flatMap() when you have a nested array (array inside another array) and you want to transform each item and flatten the result by one level. flatmap() transforms and flatten, maps only transforms. This concept is same for most programming language. Like Kotlin.
1
2
6
386
Hey JavaScript developers! What’s the difference between map and flatmap when used on an array? What situation is one better used than the other?
9
3
39
5,061
#LSPPDay4 #60DaysOfLearning2026 #LearningWithLeapfrog
 Learned and practised: ✅ find(), some(), every() ✅ flat(), flatMap() ✅ Destructuring ✅ Spread & Rest Operators ✅ Object Methods Applied everything in a One Piece themed JavaScript project! @lftechnology
26
424
Wonder if I'm alone but I keep being bitten by this kind of async FP pattern I always intuitively think it will return Promise<Item[]>, but nope 😅 Wonder what your trick is to work around array filter/map/flatMap async, while keeping code expressive
8
2
72
19,688
1/ Array.from() Turn anything iterable into an array. No more [...nodeList] hacks. 2/ flat() flatMap() Flatten nested arrays in one line. flatMap() maps AND flattens simultaneously. 3/ findIndex() Like find() but returns the index, not the value. Cleaner than forEach with a counter. 4/ at() arr.at(-1) gets the last element. No more arr[arr.length - 1] ever again. 5/ every() some() every() = do ALL items pass? some() = does AT LEAST one pass? Both return boolean. 6/ structuredClone(arr) Deep clone an array without JSON.parse(JSON.stringify()) nonsense. 7/ Object.groupBy() Group array items by a condition in one line. Landed in ES2024. Use it. 8/ Array.from({length: 5}, (_, i) => i) Generate arrays on the fly without a loop. Save this. Your future self will thank you 🔁 Which one did you not know? 👇

2
78
Replying to @chronark
> minus the monad cosplay > looks inside, flatmap, flatmap, flatpamp
1
36
3,463
Replying to @badlogicgames
I would prefer a .map or .flatMap option I guess And make the hasImage just a named variable
2
235
map vs flatMap
8
493