Day 17 of 30 of JavaScript

Day 17 of 30 of JavaScript

Hey reader👋 Hope you are doing well😊
In the last post we have talked about Inheritance in JavaScript. In this post we are going to know about some pre-defined objects in JavaScript.
So let’s get started🔥

Date Object

JavaScript Date objects let us work with dates. By default JavaScript will use the browser’s time zone and display a date as a full text string.
Eg -: Thu Jun 13 2024 22:25:30 GMT+0530 (India Standard Time)

Create a Date object -:

There are 9 different ways to create Date object-:

Date get() method-:

Date set() method-:

JavaScript Set Object

A JavaScript set object is collection of unique values. Each value can only occur once in a Set. The values can be of any type, primitive values or objects.

Creating and inserting values in set -:

Iterating on a Set-:

The values() method returns an Iterator object with the values in a Set.

Set Methods

Set Properties

JavaScript Map Object

A Map is a JavaScript object that holds key value pairs. The keys are stored in the original order of their insertion. The key can be of any data type.
Creating map and inserting values-:

Accessing values-:

Map methods -:

We will see more about these in later blogs. These are some of the objects , there are more objects in JavaScript.
I hope you have understood this blog. Don’t forget to like the blog and follow me.
Thankyou🩵