Professional Documents
Culture Documents
1/10
2/10
WE WILL LOOK AT
Events
onload
Functions
function
return
3/10
. . . code here . . .
}
4/10
varfunctionTwo=function(){
. . . code here . . .
}
varfunctionTwo=functionthisFunc(){
. . . code here . . .
}
5/10
6/10
7/10
<!doctypehtml>
<html>
<head>
<script>
functioncheck(a,b){
if(b!=0)returntrue
elsereturnfalse
}
functionmyDivide(fn,num,div){
if(fn(num,div)){
alert("It'sOK!")
returnnum/div
}else{
alert("NotOK!")
}
}
result=myDivide(check,44,1)
</script>
</head>
</html>
8/10
9/10
<!doctypehtml>
<html>
<head>
<script>
functioncounter(){
varcount=0
returnfunction(){
count++
alert(count)
}
}
varcount=counter()
count()
count()
count()
</script>
</head>
</html>
10/10