JavaScript Articles
The coding articles collection contains curated stories, tips, questions and answers on a wide variety of topics. The main focus of these articles revolves around the languages and technologies presented in snippets, as well as career advice and lessons.
Introduction to arrow functions in JavaScript
JavaScript, Article
JavaScript arrow functions are a very useful tool to learn and master. Here's a complete introduction to everything you need to know.
Replacing JavaScript switch statement with object literals
JavaScript, Article
JavaScript's
switch
statement often feels hard to remember and a little bit out of place. Maybe it's time to use object literals, instead.What's the difference between undeclared, undefined and null in JavaScript?
JavaScript, Article
JavaScript has three different empty states for variables. Learn their differences and how you can check for each one.
Is there a way to use instanceof for primitive JavaScript values?
JavaScript, Article
JavaScript's
instanceof
operator can't be used with primitive values, but there are a couple of simple tricks that you can leverage to your advantage.How do I remove a property from a JavaScript object?
JavaScript, Article
Ever wanted to delete a property from a JavaScript object? Here are a few way you can accomplish that.
What is the difference between then and finally in a JavaScript promise?
JavaScript, Article
On the surface, a JavaScript promise's
then
andfinally
methods seem very similar. But there are a few important differences you need to keep in mind.How can I clone an array in JavaScript?
JavaScript, Article
Pick up a few new tricks which you can use to clone arrays in JavaScript.
How do I empty an array in JavaScript?
JavaScript, Article
You can use a lot of different techniques to empty an array in JavaScript. See which ones best suits your needs with this quick guide.
What's the difference between Object.is() and the triple equals operator in JavaScript?
JavaScript, Article
Object.is()
and the triple equals operator (===
) can both be used for equality checking in JavaScript, but when should you use each one?Tip: Min and max value in a JavaScript array
JavaScript, Article
When working with numeric arrays in JavaScript, you might find yourself in need of finding the minimum or maximum value. Here's a quick and easy way to do it.
JavaScript console.log() tips & tricks
JavaScript, Article
Level up your JavaScript logging with these
console.log()
tips and tricks.How can I detect if Caps Lock is on with JavaScript?
JavaScript, Article
If you need to check if Caps Lock is on when the user is typing in the browser, JavaScript's got you covered.
Understanding the spread and rest syntax in Javascript
JavaScript, Article
JavaScript ES6 introduced us to several powerful features, such as the spread and rest syntax. Learn everything you need to know in this quick guide.
Tip: Remove duplicates from a JavaScript array
JavaScript, Article
Easily remove duplicates from a JavaScript array using the built-in
Set
object.Tip: Create your own query selector shorthand
JavaScript, Article
Ever wanted to create your own jquery-like query selector shorthand? Here's how!