August 18, 2009

Javascript Tutorial 10: Parameters of Functions


function add(a,b)
{
x=a+b;
return x;
}

alert (add(4,6));

Here 4=a and 6=b. An alert box will show the addition of 4+6 which equals 10.

Make it twice.

function add(a,b)
{
x=a+b;
return x;
}

alert (add(4,6));
alert (add(12,14);


At this two popups come up and they will show up the answer.





Powered by ScribeFire.

No comments:

Post a Comment