Learn how to create notification in Javascript.
The Notification API allows you to create notification on the web page.
To create notification first we need to change the notification default settings.

Here change the Notification block to allow. So the notification will be displayed .
To check for notification support in the browser ,

To check thr current permission(denied/ granted) on the current page, we can user Notification.permission read only property .If the permission is denied we need to enable it. If the permission is granted then we can create notification .
To create a notification

The above code will create a new notification with icon.
If we don’t need the icon , we can simply use
var notification = new Notification("hi there");
If you find this helpful surprise 🎁 me here.
Share if you feel happy 😃 😆 🙂 .
Follow Javascript Jeep🚙 if you feel worthy.
Referred from mozilla.