Skip to content

Instantly share code, notes, and snippets.

View allonsmandy's full-sized avatar
👩‍💻
Working from home

Amanda Almeida Matos allonsmandy

👩‍💻
Working from home
View GitHub Profile
@allonsmandy
allonsmandy / filterArray.js
Created January 4, 2021 14:46 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@allonsmandy
allonsmandy / React.md
Created September 22, 2019 08:29 — forked from taniarascia/React.md
React notes

React Notes

  • A React component can only return one parent element.
return <h1>Hello</h1><p>World</p>            // error
return <div><h1>Hello</h1><p>World</p></div> // okay 
  • JavaScript expressions can be interpolated in JSX with {}