javascriptoperators

Question about javascript function declaration


What does it mean when a javascript function is declared in the following way:

JSON.stringify = JSON.stringify || function (obj)
{
  //stuff
};

How is the above different from just declaring it like below?

function stringify(obj)
{
  //stuff
}

Solution