---
name: take
kind: function
lang: go
domain: core
version: "1.0.0"
purity: pure
signature: "func Take[T any](slice []T, n int) []T"
description: "Devuelve los primeros n elementos de un slice."
tags: [slice, functional, generic]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: []
params:
  - name: slice
    desc: "slice del cual tomar elementos del inicio"
  - name: n
    desc: "cantidad de elementos a tomar desde el inicio"
output: "nuevo slice con los primeros n elementos; si n > len(slice), retorna el slice completo"
tested: false
tests: []
test_file_path: ""
file_path: "functions/core/take.go"
---

## Ejemplo

```go
result := Take([]int{1, 2, 3, 4, 5}, 3)
// result = [1, 2, 3]
```

## Notas

Funcion pura generica. Implementacion en devfactory/core.
