0

Functions (3/3) [autolearn]

how to make a functions

27th Nov 2016, 12:38 PM
Pytness
Pytness - avatar
2 Respostas
+ 2
We can use: function name(args) {} Or: var name = function(args) {} Or: var name = (args) => {}
27th Nov 2016, 12:42 PM
Pytness
Pytness - avatar
+ 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
27th Nov 2016, 12:47 PM
Pytness
Pytness - avatar