Javascript Tips
From Logic Wiki
Contents
Shorten the console.log
const log = console.log.bind(document)
log("some message")
Use isNum to verify a number
function isNum(n) {return !isNaN(parseFloat(n)) && isFinite(n);}
Use isNull
const isNull = value => value === null || value === undefined;
Remove duplicates from an array
const delDuplicates = array => [...new Set(array)]