function findMax() {
// console.log(arguments);
var max = arguments[0];
for (var i of arguments) {
// console.log(i);
if (max > i) {
max = max;
} else {
max = i;
}
}
return max;
}
var x = findMax(1, 123, 500, 115, 44, 88);
console.log(x);
function sum(x, y) {
if (y == undefined) {
return function (m) {
return x + m;
}
}
return x + y;
}
var s = sum(2, 3);
console.log(s);
var s1 = sum(2)(3);
console.log(s1);