Favorite JavaScript utilities in single line of code! No more!
Star me on GitHub ● 6284★
Array
Cast a value as an array
Check if an array is empty
Compare two arrays regardless of order
Clone an array
Convert an array of objects to a single object
Convert an array of strings to numbers
Count by the properties of an array of objects
Count the occurrences of a value in an array
See all 50 helpers
DOM
Check if an element is a descendant of another
Check if an element is focused
Check if the touch events are supported
Detect Internet Explorer browser
Check if user scrolls to the bottom of the page
Detect macOS browser
Get all siblings of an element
Get the selected text
See all 23 helpers
Date Time
Add AM PM suffix to an hour
Calculate the number of months between two dates
Calculate the number of difference days between two dates
Compare two dates
Convert a date to YYYY-MM-DD format
Convert seconds to hh:mm:ss format
Determine one year from now
Extract year, month, day, hour, minute, second and millisecond from a date
See all 24 helpers
Function
Box handler
Check if a value is an async function
Compose functions from left to right
Check if a value is a generator function
Curry a function
Check if a value is a function
Create an empty function
Compose functions
See all 17 helpers
Math
Calculate the midpoint between two points
Calculate the linear interpolation between two numbers
Check if a point is inside a rectangle
Calculate the angle of a line defined by two points
Check if a rectangle contains other one
Calculate the distance between two points
Convert degrees to radians
Check if a rectangle overlaps other one
See all 11 helpers
Misc
Check if the code is running in the browser
Check if the code is running in NodeJS
Check if the code is running in Jest
Clear all cookies
Convert 3 digits color to 6 digits color
Convert cookie to object
Convert hex to rgb
Convert Fahrenheit to Celsius
See all 25 helpers
Number
Calculate Fibonacci numbers
Add an ordinal suffix to a number
Calculate the average of arguments
Calculate the division of arguments
Calculate the mod of collection index
Calculate the remainder of division of arguments
Clamp a number between two values
Compute the greatest common divisor between two numbers
See all 21 helpers
Object
Check if multiple objects are equal
Create an empty map that does not have properties
Create an object from the pairs of key and value
Extract values of a property from an array of objects
Get the value at given path of an object
Immutably rename object keys
Omit a subset of properties from an object
Invert keys and values of an object
See all 12 helpers
Random
Generate a random boolean
Generate a random integer in given range
Generate a random floating point number in given range
Generate a random hex color
Generate a random string using Node crypto module
Generate a random string from given characters
Generate a random IP address
Generate a random UUID
See all 16 helpers
String
Capitalize a string
Check if a path is relative
Check if a string is a palindrome
Check if a URL is absolute
Check if two strings are anagram
Convert a base64 encoded string to an uint8 array
Check if a string consists of a repeated character sequence
Convert a string to camelCase
See all 51 helpers
Validator
Check if a date is a weekend
Check if a character is a digit
Check if a date is a weekday
Check if a date is between two dates
Check if a date is today
Check if a date occurs in the current year
Check if a given integer is a prime number
Check if a flat array has duplicate values
See all 47 helpers
Follow me on
Twitter
and
GitHub
to get more useful contents.