function a (text="called function alert") { alert(text); } /* a("hello"); */ /* function cube (number) { return number **3; } a(cube(3)); */ /* function avg(a,b){ return ((a+b)/2); } a(avg(1,2)); a(avg(10,5)); */ /* function sum3 (a=0,b=0,c=0) { return a+b+c; } a(sum3(1,2,3)); a(sum3(5,10,100500)); a(sum3(10,5)); */ /* function intRandom (min,max=0) { if(max == 0 ){ return Math.floor(Math.random()* (min-max+1))+max; } return Math.floor(Math.random()* (max-min+1))+min; } a(intRandom(100)); */ /* function greetAll(...names) { let greetArr = []; for(let i = 0 ; i< arguments.length; i++){ greetArr.push(names[i]); } alert(greetArr); } greetAll("SPYDIK","KYRKA","VETAL"); */ function sum(...numarr){ /* let result=0; for(let i =0; i a+b)); */ } sum(...[10,2,20]);