1. You can download this document from www.besthinditutorials.com
JavaScript functions
Introduction to JavaScript functions in Hindi
Defining JavaScript functions in Hindi
Calling JavaScript functions in Hindi
Parameters of JavaScript functions in Hindi
Introduction to JavaScript functions
Functions आप code program ई जगह प
ह Functions आप ए ह code
च ज ह code re-usability ह आप ए ह code ज
program ई जगह apply ह Functions आप program
structured औ readable ज ह
JavaScript built in functions provide ह ज आप प program
ह functions regularly perform ह basic task
perform ह आ functions ज ह
JavaScript built in Functions
JavaScript 5 built in functions ह ज आप access प according
ह
Functions Description
eval() function pass गए string evaluate ह
string ई number ह return ह ह
terminate ह ज ह
parseInt() function 2 parameters pass ज ह पह
parameters ए string ह ह औ parameter ए
integer ह ह ज base represent ह ज 10
16 function string according base ए number
return ह
parseFloat() function ए string read ह औ string float
2. You can download this document from www.besthinditutorials.com
ह function return ह
escape() function ए string characters convert
return ह ज space जगह + sign औ
alphanumeric values जगह % return ज ह
unescape() function escape() function result प
original convert ज ह
Defining JavaScript functions
JavaScript functions define आ ह ए आप function
keyword ह keyword आप function ह औ
parameters list define ह JavaScript function define
structure च ग ह
function funcName (parameters-list)
{
//your code here
}
structure base प आप ई JavaScript function create ह
JavaScript functions create ह च ज ह ह
<script type="text/css">
function hello()
{
document.write("Hello reader!");
}
</script>
3. You can download this document from www.besthinditutorials.com
Calling JavaScript function
Function define use ए आप call ह
ह Function आप प program ह call ह ए आप
function ह औ आग brackets ग semicolon ग
ह
<html>
<head>
<title>JavaScript function calling demo</title>
<script type="text/javascript">
function hello()
{
document.write("hello reader!");
}
</script>
</head>
<body>
<script type="text/javascript">
hello();
</script>
</body>
</html>
Function with parameters
आप च ह function ई value pass ह औ function value
evaluate output show ह Function ई value pass
ए आप brackets parameter define ह Parameter define
ए आप variable ह ज value hold ग ह च
ग ह
4. You can download this document from www.besthinditutorials.com
<script type="text/javascript">
function hello(name) //name is a parameter
{
document.write("hello"+name);
}
</script>
Parameter define ज आप function call ह parameter
ए ए value pass ह ह value function ज ह
औ function प execution ह ह च ग ह
<script type="text/javascript">
hello('reader'); // calling function with value
</script>
Read more on JavaScript in Hindi at www.besthinditutorials.com