Home >> Javascript >> Functions in Javascript

Functions in Javascript

A block of code that perform a specific task. we can call function many times to reuse the code.

Advantage 

1)-Code reusabilty

2)-Less coding

Syntax

function functionname(arg1,arg2,.....,argn){

//code to be executed

}

Example

function msg(){

alert("Hello! this is test message");

}

Post Your Comment

Next Questions
Objects
Array
Events
Onchange event
Onclick event
Onmouseover event
Onmouseout
Onkeydown event
Onload event

Copyright ©2022 coderraj.com. All Rights Reserved.