i want to add two number six times by looping & function calling. loop execute properly but function not execute properly. here the function may not called.please help. Thanks in advance
<html>
<head>
<script type="text/javascript">
var i=10;
for(j=1;j<=6;j++) {
var x=fun(3,4);
document.write(x);
i++;
}
function fun(var i, var j) {
var k=i+j;
return k;
}
</script>
</head>
<body>
</body>
</html>
varin the function declaration.document.writeshould almost never be used. If you don't know why, then it should never be used. The only good way to usedocument.write- stackoverflow.com/a/20436093/1435655