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
|
function dilver(dum,add) //dilver accepts two parameters, dum, add
{
function dum(a,b) // first error, dum is a parameter, but redefined here
{
var a= 12; // second error, a is parameter, but redefined here
var b =15; // third error, b is parameter, but redefined here
return var d = a+b; // forth error, cannot declare variable in return statement
}
function add(c,d) // fifth error, add is a parameter, but redefined here
{
var c = 50; // sixth error, c is a parameter, but redefined here
var d = 100; // seventh error, d is a parameter, but redefined here
return var l = c+d; // eighth error, cannot declare variable in return statement
}
return dum() + add(); // would normally work, but error 4 and 8 would break compilation, and thus will not work
}
var hunter = dilver(d,l); // ninth error, d and l are out of scope, not to mention not correctly declared
document.write(hunter); // would normally work, but given all other errors, will not.
|