This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
db: | |
container_name: my-pg-container | |
image: postgres | |
restart: always | |
ports: | |
- "5432:5432" | |
environment: | |
- POSTGRES_USER=postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CREDIT TO: https://jasonformat.com/reusable-array-search-predicates/ | |
// Given an Array of objects: | |
const blogPosts = [ | |
{ name:'one', tags:['a', 'b'], published: '2016-10-31' }, | |
{ name:'two', tags:['c'], published: '2019-01-05' }, | |
{ name:'three', tags:['b'], published: '2021-06-06' }, | |
... | |
]; | |
// Create reusable search predicates using `this`: |