1loc
v1.2.0
Published
One line of code as a library
Downloads
43
Readme
1Loc Lib
A library of witty Javascript one-liner functions. The 1loc.dev website has a collection of useful Javascript one-liners, now you get to use them in your Javascript projects.
One Liners are great, but the rest of your team would appreciate a little more clarity, So we've abstracted them for you, as readeable function names, so you and your teammates can focus on important stuff.
TOC
Getting Started
Install the 1Loc library using yarn or npm
yarn add 1locor using npm
npm i 1loc --saveImport Any One-liner and use
import { cloneArray } from '1loc'
const myArray = [{ name: 'me', age: 2}]
const arrayClone = cloneArray(myArray) // [{ name: 'me', age: 2}]
More Examples
import { arrayHasSameValues } from '1loc'
const hasSameValues = arrayHasSameValues([1, 2, 4], [4, 1, 2])
console.log(hasSameValues) // trueExplore a list of possible One-liners
You can also visit the original 1loc website here.
One Liners
Here's a collection of function definitions and what they do.
