Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • JavaScript Function Syntax

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 43
    Comment on it

    JavaScript Function

    A function is a separate part of the program that performs a particular task. The code of the function can be reused by calling the same function wherever it is required to perform the same task.

    A function syntax is as the keyword function followed by function name, followed by a list of parameters and a statement block in curly brackets.

    example:

    function fun(parameter1,parameter2){
    .
    statement 1;
    statement 2;
    .
    .
    statement n;
    }
    

    Here, in the above example fun is the name of the function and parameter1, parameter2 are the parameters list. The parameters of the function receives the values to work on. The body of the function contains statement 1,statement 2 . . . statement n covered under curly brackets.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: