DEV Community

Akshat Sharma
Akshat Sharma

Posted on

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 -:
Image description
There are 9 different ways to create Date object-:
Image description

Date get() method-:
Image description

Date set() method-:
Image description

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 -:
Image description

Iterating on a Set-:
Image description
The values() method returns an Iterator object with the values in a Set.

Set Methods
Image description

Set Properties
Image description

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-:
Image description

Accessing values-:
Image description

Map methods -:
Image description

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🩵

Top comments (0)