Question:What is function? How can you define function in JavaScript? 

Answer 
Function:


1. A colloection of statements/code which can perform a specific task and can be executed by an event of call to that function.
2. We can have a) Built-in function and 2) User-defined functions

Syntax of defining a function:

function functionName(functionParameter list){
 
   statements

}

Example:

function add(a,b){
   return a+b;


Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in D:\webserver\www\vcampusbd_com_https\answers\column_answer_two.php on line 128
+ Report
Total Preview: 1128
What is function? How can you define function in JavaScript?
Copyright © 2024. Powered by Intellect Software Ltd