Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure — a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.

A function definition (a function declaration) consists of the function keyword, followed by:

  • The name of the function.
  • A list of parameters to the function separated by commas and enclosed in parentheses.
  • The JavaScript statements that define the function, enclosed in curly brackets, {...}.

Example, the following code defines a simple function…

Firebase is a platform that offers various services for mobile and web applications and helps developers build an application quickly with a lot of features. We can send push notification to the client with firebase cloud messaging, which allows us to send messages to any devices over the network using an HTTP request.

In this article, I will be going to show you how we can trigger push notification from a web page from javascript.
You can visit the demo web application or you can check code on GitHub.

Here I going to make two web pages, one service worker…

Bharat Agarwal

Opensource Contributor, Working on Full Stack Development in Web and Mobile (Flutter) platform, also Cybersecurity Enthusiast.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store