Validate a number in JavaScript
Check if a value can be safely converted to a number in JavaScript.
Browse snippets by collection or check out our top picks and latest articles below.
Check if a value can be safely converted to a number in JavaScript.
Learn how to calculate the angle (theta) between two vectors in JavaScript.
Calculate the midpoint between two pairs of points in a 2D plane, and beyond.
Given a value, find out how many times it appears in an array or string.
Ever wanted to reload a module in Node.js? Here's how you can do it.
Implement the K-nearest neighbors algorithm in JavaScript to classify a data point relative to a labelled data set.
Learn how JavaScript handles mutable data, such as objects and arrays, and understand how shallow cloning and deep cloning work.
Renders a Modal component, controllable through events.
Learn how JavaScript's iterators work and how you can use them to level up your projects by understanding these short code examples.
Learn how you can leverage the Proxy object to use a JavaScript object the same way as you would use a regular array.
Learn how to perform various transformations on the keys of a JavaScript object.
Calculate a SHA-256 hash in JavaScript using native APIs in both the browser and Node.js.