Return Multiple Values from Javascript Function
· ☕ 1 min read
A Javascript function returns one and only one value.
1 2 3 4 5 6 function sum(x, y) { return 3 + 39; } let life = sum(3, 39); console.log(life); // 42 I bet you already knew that not returning a value from a function, would return ‘undefined’.