Reputation: 51
Just wondering the difference in these 2 functions...
function getArea(width, height) {
return width * height;
}
function getArea(width, height) {
var area = width * height;
return area;
}
I guess my question is, what is the point in the second example by storing the parameters in a variable?
Upvotes: 1
Views: 64
Reputation: 1259
The point to expanding your code this way would be for:
On the other side, the benefit of not doing this would be:
Upvotes: 2