Understanding the "this" keyword in JavaScript
JavaScript's this
keyword can confuse beginners and veterans alike. Learn how it works in different scenarios and start using it correctly.
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.
JavaScript's this
keyword can confuse beginners and veterans alike. Learn how it works in different scenarios and start using it correctly.
Maps and objects are very similar, but they have some differences that can help you decide which one better fits your use-case.
Did you know you can get the index of an array item in a JavaScript for...of loop? Learn how with this bite-sized tip.
Function arity is a simple, yet useful concept in functional programming, especially when combined with currying.
Currying is a process that transforms a function that takes multiple arguments into a series of functions that each take a single argument.
JavaScript uses callback functions quite a lot. From event listeners to asynchronous code, they're an invaluable tool you need to master.
Ever wanted to listen for multiple events on an element and handle them with the same function? Here's how!
Chunk an array or iterable into arrays of a specified size or a given number of chunks.
Quickly and easily replace or append a value in a JavaScript array.
Not sure if you need to prefix a CSS property in order to use it? Here's a simple way to figure it out!
Ever needed to convert a NodeList
to an array in JavaScript? Here's the fastest way to do so.
Learn all of the options JavaScript provides for modifying the URL of the current page in the browser without reloading the page.
Sort an array of numbers, using the heapsort algorithm.
Understand how events work in JavaScript and learn when to use event bubbling, event capturing and event delegation with this short guide.
Leverage the Date
object to check if a given date is inside business hours.
Calculate the ranking of an array based on a comparator function in JavaScript.
Level up your event handling skills by learning how to attach or detach event listeners from multiple elements at once.
Ever wanted to get the value of an HTML input element as a number? Learn an easy way to do it with this handy trick.
Sort an array of numbers, using the selection sort algorithm.
Sort an array of numbers, using the quicksort algorithm.
Learn how you can compare two objects in JavaScript using various different techniques.
Implement the Luhn Algorithm, used to validate a variety of identification numbers.
Closures are used frequently, yet often misunderstood. Understanding them in depth is crucial to be able to write clean, maintainable code.
Defer the invocation of a function until the current call stack has been cleared.