+ 5
for example if you have a big formula you can do in two ways:
1 without return
x = 3
y = 2
a = x * (y - 3) * 4 - x
x = 6
y = 1
b = x * (y - 3) * 4 - x
2 with return
function formula(x, y){
return x * (y - 3) * 4 - x
}
a = formula(3, 2)
b = formula(6, 1)
result is same but more easy to read and write