Which two code segments declare JavaScript functions? (Choose two.)
...}
Example:
function add(x, y) {
return x + y;
}
var t = add(1, 2);
alert(t); //3
Example:
//x,y is the argument. 'returnx+y' is the function body, which is the last in the argument list.
var add = new Function('x', 'y', 'return x+y');
var t = add(1, 2);
alert(t); //3
Incorrect:
Not A: funct keyword not used in JavaScript
Currently there are no comments in this discussion, be the first to comment!