Category: FAQs

Recent Post

How to get the length of an object in JavaScript

Unlike arrays and strings, objects don't have a length property to query.

How to create a universally unique identifier (UUID) in JavaScript

Easily generate UUIDs in standard format using the Web Crypto API.

How to wait until an element exists in JavaScript

Wait until an element exists to do something in JavaScript using the MutationObserver API.

The right way to generate a random number in JavaScript

In JavaScript, you can generate a weakly random number quickly or a strongly random number slowly.

Print only the content of a webpage using CSS and JavaScript

Send an entire web page (or only part of it) for printing using window.print().

How to redirect to another web page using JavaScript

How to send a user to another page immediately upon page load or with a countdown delay.

How to print a JavaScript array to the DOM

Learn how to print a JavaScript array to the DOM in readable format.

Check if a HTML input element contains (no) user input

How to check if a user has provided input to a HTML input element.

How to sort an array of objects by the value of a property in JavaScript

Learn how to sort an array of objects by the value of a property.

Emptying a JavaScript array

Emptying an array is easy, but methods vary in their impact on references made to the array in other