-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.html
More file actions
27 lines (27 loc) · 802 Bytes
/
function.html
File metadata and controls
27 lines (27 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<head></head>
<body>
<h2>Javascript arument object</h2>
<p id="p1"></p>
<script>
function getNymber(){
return 10;
}
let result = getNymber();
document.getElementById("p1").innerHTML= result ;
</script>
<h3> Default parameter example </h3>
<p id="p2"></p>
<p id="p3"></p>
<script>
//default function parameter
function add(a=20,b=40){
return a+b;
}
let data = add(100,200);
document.getElementById("p3").innerHTML =data;
document.getElementById( "p2" ).innerHTML = add() + "<br>" + add(5) + "<br>" +add(undefined,6);
</script>
</body>
</html>