---
title: "Discussion on \"Notes: Golang generics with map, filter, and reduce implementation\" | Hashnode"
description: "Discussion on \"Notes: Golang generics with map, filter, and reduce implementation\". In this blog blog, we’ll see how Go generics can be used to write popular JS array methods.\nMap (Transform each element in a slice)\nfunc Map[T any, R any](slice []T, fn func(T) R) []R {\n    result := make([]R, len(slice))\n    for i, v := range slice ..."
url: "https://hashnode.com/posts/notes-golang-generics-with-map-filter-and-reduce-implementation/68457d429a35401c53bc36ff"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Notes: Golang generics with map, filter, and reduce implementation](https://btree.dev/notes-golang-generics-with-map-filter-and-reduce-implementation?utm_source=hashnode&utm_medium=feed)

In this blog blog, we’ll see how Go generics can be used to write popular JS array methods. Map (Transform each element in a slice) func Map\[T any, R any\](slice \[\]T, fn func(T) R) \[\]R { result := make(\[\]R, len(slice)) for i, v := range slice ...

Sep 13, 2022 · 2 min read · btree.dev  
Updated Jun 12, 2025  
Read the article

-   [#go](https://hashnode.com/tag/go)
-   [#generics](https://hashnode.com/tag/generics)

## Written by

[kshitij kumar](https://hashnode.com/@btree)

@btree

  
[View profile](https://hashnode.com/@btree)

Backend Engineer @ Getir

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
