Javascript Programming

What is Function In Javascripts ?

In this tutorial, we will Learn What is Function In Javascript

What is Function? -> A function is a group of reusable code which can be called anywhere in your program. This eliminates the need of writing the same code again and again

Define Function In Javascript?

we need to define Function. common way to define a function in JavaScript is by using the function keyword

Syntex:-

<script type = "text/javascript">
      function functionname(parameter-list) {
         // statements
      }
</script>

Simple Example :-

<script type = "text/javascript">
   <!--
      function sayHello() {
         alert("Hello there");
      }
   //-->
</script>

Related posts

Addition Subtraction Multiplication Division Using Ajax

Mayur Tekwani

JavaScript Date Print On Web Page

codebugs@admin

Loops In JavaScript – 2

Mayur Tekwani

Leave a Comment