DEV Community

Akshat Sharma
Akshat Sharma

Posted on

1 1 1 1 1

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🩵

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up