Eloquent JavaScript: Two ways to declare a function

I’m reading through “Eloquent JavaScript,” and I found this interesting.

There are two ways to declare a JavaScript function:

#!/usr/bin/env node
/* Eloquent JavaScript, Chapter 3, Page 42

Define a Function - power

*/

var power = function(base, exponent) {
  var result = 1;
  for (var count = 0; count < exponent; count++)
    result *= base;
  return result;
};

console.log(power(3, 15));

With the function declared a different way:

#!/usr/bin/env node
/* Eloquent JavaScript, Chapter 3, Page 42

Define a Function - power (modified)

*/

function power(base, exponent) {
  var result = 1;
  for (var count = 0; count < exponent; count++)
    result *= base;
  return result;
};

console.log(power(3, 15));

Here are the differences:

First version

var power = function(base, exponent) {

Second version

function power(base, exponent) {