funciontallibrary

funciones a usar en programacion funcional

Usage no npm install needed!

<script type="module">
  import funciontallibrary from 'https://cdn.skypack.dev/funciontallibrary';
</script>

README

Functional Library

Librería de funciones usadas para programación funcional.

setNewProperty

Basic

const person = {
    id: 1, 
    name: 'Andres',
};
setNewProperty('age', 69)(person)
result: person = { id: 1, name: 'Andres', age: 69 }

in Arrays

const persons = [
    { id: 1, name: 'Andres' },
    { id: 2, name: 'Ada' },
];
const personsUpdates = persons.map(setNewProperty('age', 69))
result:
persons = [
    { id: 1, name: 'Andres', age: 69 },
    { id: 2, name: 'Ada', age: 69 },
];