developit / developit/jasonformat.com

I have no Twitter but I'd like to comment:

Abierto
#5 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
20
Forks
6
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi Jason,

Apologies for (mis)using github issues as a place for comments (see subject line)

I just read your blogpost: [Quick tip: reusable Array search predicates](https://jasonformat.com/reusable-array-search-predicates). In the past I've achieved a similar effect (in terms of developer experience) by having a function that returns a function eg.
```
const byId = (value) => {
return (element) => {
element.id == value;
}
}

myArray.filter( byId(12) );
```
Of course each time I'm creating a new function for the predicate so I'm not really reusing it but it feels that way (as I say, dev experience...). I wonder if you have any insight into how the two approaches might differ, performance or other-wise.

Thanks for writing your blog, it's always interesting.

Tom

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.