0
Functions (3/3) [autolearn]
how to make a functions
2 Antworten
+ 2
We can use:
function name(args) {}
Or:
var name = function(args) {}
Or:
var name = (args) => {}
+ 1
var f = (x, y) => x+y;
f(2,3); // 5
var f2 = (x, y, z) => {
var a = x+y;
return a*z;
};
f2(2, 3, 2); //10