Technical Training
JavaScript TutorialPassing values to JavaScript Function
Passing values to JavaScript Function
In this JavaScript Tutorial you will learn about how to pass values to and also how to return values from a JavaScript function.
Passing Values to function:
Values can be passed to a function as parameters.
The general syntax for passing values to a function in JavaScript is:
………………………………………… }
function name_of_function(argument1,argument2,…argumentn)
{
//Block of Code
…………………………………………
In the above argument1, argument2,...argumentn represents the values passed to the function.
For Example:
Suppose a programmer wants to create a function with name exforsys, which takes two values x and y.
These two values are passed from the calling program. Then function takes up the shape as follows:
………………………………………… }
function exforsys(x,y)
{
//Block of Code
…………………………………………
Suppose the values passed to the function from the calling program are 10 and 15.
Then, from the calling program the function is called as follows:
|
JavaScript Tutorial
- JavaScript Browser Objects Part 2
- JavaScript Frame object
- JavaScript Form Object
- JavaScript FileUpload Object
- JavaScript Event Object Properties and Methods
- JavaScript Event Object
- JavaScript Elements and Embed Objects
- JavaScript Applet Objects
- JavaScript Browser Objects
- JavaScript Object Oriented Features
- JavaScript Window Object Open Method Part 2
- JavaScript Window Object Open Method
- JavaScript Window Object Timeout Methods
- JavaScript Location Object
- JavaScript Location Object Properties
- JavaScript History Object Properties and Methods
- JavaScript Document Object Methods Part II
- JavaScript Document Object Methods Part I
- JavaScript Document Object Properties
- JavaScript Document Object
- JavaScript Windows Object Properties Part II
- JavaScript Windows Object Properties Part I
- JavaScript DOM Window Object
- Working with JavaScript DOM Objects
- JavaScript Array Object Methods – Part II
- JavaScript Array Object
- JavaScript Array Object Methods – Part I
- JavaScript Boolean Object
- JavaScript OnError Event
- JavaScript Exception Handling – Part II
- JavaScript Exception Handling – Part I
- JavaScript Event Handler
- JavaScript Events Handling
- JavaScript Array Operations
- JavaScript Two Dimensional Arrays
- Passing values to JavaScript Function
- JavaScript Functions
- JavaScript Arrays
- JavaScript Iterative Structures - Part II
- JavaScript Iterative Structures - Part I
- JavaScript Math Object
- JavaScript Date Object
- JavaScript String Object
- JavaScript Objects
- JavaScript Confirm Box
- JavaScript Alert Box
- JavaScript Conditional Statements Part 2
- JavaScript Conditional Statements Part 1
- How to use JavaScript in HTML page
- JavaScript Variables
- JavaScript Features
- JavaScript Introduction







