JavaScript function without defining parameters
function add() { var result = 0; for (var i = 0; i < arguments.length; i++) { result = result + arguments[i]; } return result; }
Result :
> add(3,7,8,10) 28
Post a Comment
No comments:
Post a Comment