JavaScript Snippets

The JavaScript snippet collection contains a wide variety of ES6 helper functions. It includes helpers for dealing with primitives, arrays and objects, as well as algorithms, DOM manipulation functions and Node.js utilities. In total 3 articles on this site. Use the search below to filter by title.

All Posts

luhnCheck

Implementation of the Luhn Algorithm used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc.

kMeans

Groups the given data into k clusters, using the k-means clustering algorithm.

indexBy

Creates an object from an array, using a function to map each value to a key.