What's the difference between these codes


#1

Are they the same or is there a difference?

var perimeterBox = function(length, width) {
    return length + length + width + width;
}

perimeterBox(5, 4);

VS

function perimeterBox(length, width) {
    return length + length + width + width;
}

perimeterBox(5, 4);

Thank you.


#2

function declaration vs function expressions, i highly recommend reading this to understand the differences


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.