How-to articles, tricks, and solutions about JAVASCRIPT OBJECT

Colors in JavaScript Console

The console.log() method outputs a message to the web console. Read the tutorial and learn the simplest method of putting a single or multiple styles to it.

How the Keyword “this” Works

In this tutorial, you can find information about the usage of the keyword “this” in JavaScript. Here, it works differently compared with other languages.

How to Add Days to JavaScript Date

Read the tutorial and learn a simple method of adding days to JavaScript date with two inbuilt functions used for setting and getting the day of the month.

How To Add New Elements To A JavaScript Array

To add new elements you can use the following JavaScript functions: push() unshift(), concat() function or splice(). See examples.

How to Check for the Existence of Nested JavaScript Object Key

In this tutorial, you will find several methods that are used to test the existence of the nested JavaScript object keys. Also, find how to avoid TypeError.

How to Check if a Key Exists in JavaScript Object

This snippet is explaining how to check whether a key exists in a JavaScript object. Examine the solutions given above and choose the most appropriate.

How to Check if a Value is an Object in JavaScript

Checking the data type of the value can be misleading. Read this tutorial and learn which operator is used to check if a value is an object in JavaScript.

How to Check if a Variable is of Function Type

Read this JavaScript tutorial and learn several fast and useful methods that are invoked for checking whether the variable is of function type or not.

How to Check if an Object has a Specific Property in JavaScript

Read this tutorial and learn the methods of checking whether the specified object has the specified property in JavaScript. Find the fastest one for you.

How to Check if Function Exists in JavaScript

In this tutorial, you will read and learn information about the two methods of checking whether a function exists in JavaScript or it has not been defined.

How to Check if JavaScript Object is Empty

Read this tutorial and find methods of checking whether a JavaScript object is empty or not. Choose the best one for you and get the code immediately.

How to Check Whether a String Matches a RegEx in JavaScript

Read and learn two methods used to check whether a string matches RegEx in JavaScript. Also, see which method is the fastest and differences between them.

How to Check Whether an Object is a Date

Read this JavaScript tutorial and learn several ways that are used for checking whether the parameter passed to the method is of type Date object or not.

How to Clone a Date Object in JavaScript

Read the tutorial and learn two useful methods that are used to clone the Date object in JavaScript. Get the current date and the cloned one right away.

How to Clone a JavaScript Object

Cloning an object in JavaScript is one of the most common and complicated practices at the same. In this chapter, we will explain how to do it correctly.

How to Compare Two JavaScrpt Arrays

You can either loop through the arrays or convert them to string and then compare. This tutorial provides several fast methods of comparing two arrays.

How to Convert a JavaScript Date to UTC

In this tutorial, you will read and learn useful information about the right way of converting a JavaScript Date to the Coordinated Universal Time standard.

How to Convert a PHP Object to an Associative Array

If you want to get a proper explanation of how to convert a PHP object to an associative array, you are in the right place. Just follow the examples.

How to Convert a Unix Timestamp to Time in JavaScript

Read the tutorial and find how you can convert the UNIX timestamp to time in JavaScript to make the Unix format date-time value in a user-readable format.

How to Convert Object to String

Read this JavaScript tutorial and learn about the fastest methods of converting object into string. Read about JSON.stringify() and toString() methods.

How to Convert Set to Array in JavaScript

Read the tutorial and learn about several methods used for converting Set to Array in JavaScript. Also, read about differences between these two structures.

How to Count the Number if Keys/Properties of a JavaScript object

It is frequently necessary to count the number of keys/properties of an object in JavaScript. Find several solutions to that issue in this short tutorial.

How to Create a Two Dimensional Array in JavaScript

The two-dimensional array is an array of arrays. Read this JavaScript tutorial and find out several methods of creating two dimensional arrays easily.

How to Detect a Click Outside an Element

A common pattern used in JavaScript is detecting a click outside an element. This snippet offers you the most efficient ones among the various solutions.

How to Display a JavaScript Object

Sometimes it is necessary to display a JavaScript object. With the help of the given tutorial, you will find the best solutions to displaying an object.

1 2