Created
March 16, 2023 07:59
-
-
Save Lawondyss/c2d3b9dff49cc1d9bb82d32eebae56c0 to your computer and use it in GitHub Desktop.
JavaScript one-line snippets
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
const randomNumber = (min, max) => Math.random() * (max - min) + min; | |
const isNil = (val) => val === null || val === undefined; | |
const removeDuplicates = (arr) => [...new Set(arr)]; | |
const isDateString = (val) => !isNaN(Date.parse(val)); | |
const shuffle = (arr) => arr.sort(() => Math.random() - 0.5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment