0

I'm trying to get to grips with JavaScript for more than just simple JQuery DOM manipulation and something is confusing me.

I've been looking through sample code and seen the following two patterns in the same sample which seem to both be equivalent...

var Car = function(){}
var c = new Car();

and

function Van(){}  
var v = new Van();

Is there any difference between them? Why would you use one over the other?

BenCr
  • 5,741
  • 5
  • 39
  • 65
  • If you're interested in the sample it's from this blog post http://dailyjs.com/2012/12/13/backbone-tutorial-3/. Here's the Git repo. https://github.com/alexyoung/dailyjs-backbone-tutorial – BenCr Sep 06 '13 at 10:19
  • Brilliant, answered within a minute. Thanks. I'll close. – BenCr Sep 06 '13 at 10:25

0 Answers0