2 replaced http://stackoverflow.com/ with https://stackoverflow.com/ edited May 23 '17 at 12:40 Your first example is an expression while the second example is a statement. Defining functions as expressions allows for more flexibility in where the definition can occur, what you can assign it to, that you can pass it as a parameter, etc... For example: ``````SomeThing('abc', function(a,b) {return a*b;}); `````` vs... ``````function tmp(a,b) { return a*b; } SomeThing('abc', tmp); `````` More complex examples would become obcenely complicated without the function expression syntax. Your first example is an expression while the second example is a statement. Defining functions as expressions allows for more flexibility in where the definition can occur, what you can assign it to, that you can pass it as a parameter, etc... For example: ``````SomeThing('abc', function(a,b) {return a*b;}); `````` vs... ``````function tmp(a,b) { return a*b; } SomeThing('abc', tmp); `````` More complex examples would become obcenely complicated without the function expression syntax. Your first example is an expression while the second example is a statement. Defining functions as expressions allows for more flexibility in where the definition can occur, what you can assign it to, that you can pass it as a parameter, etc... For example: ``````SomeThing('abc', function(a,b) {return a*b;}); `````` vs... ``````function tmp(a,b) { return a*b; } SomeThing('abc', tmp); `````` More complex examples would become obcenely complicated without the function expression syntax. 1 answered Aug 13 '12 at 22:25 gahooa 2,0411010 silver badges1616 bronze badges Your first example is an expression while the second example is a statement. Defining functions as expressions allows for more flexibility in where the definition can occur, what you can assign it to, that you can pass it as a parameter, etc... For example: ``````SomeThing('abc', function(a,b) {return a*b;}); `````` vs... ``````function tmp(a,b) { return a*b; } SomeThing('abc', tmp); `````` More complex examples would become obcenely complicated without the function expression syntax.