Day 17 of 30 of JavaScript
Akshat Sharma
Posted on June 13, 2024
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-:
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.
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-:
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🩵
Posted on June 13, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 29, 2024