Implementation of SQL's coalesce function: return the first argument that is not null
From Postgres document: https://www.postgresql.org/docs/9.5/functions-conditional.html
The
COALESCE
function returns the first of its arguments that is not null. Null is returned only if all arguments are null.
npm install pg-coalesce
const coalesce = require("pg-coalesce");
console.log(coalesce(null, "Hello world")); //Hello world