First of all, in JavaScript there is no such thing as "private static". What you use here is a simple closure that creates an Instant Call Function Expression .
Your question is not entirely clear, but I think you want to count the created Car instances, and this will not work, because when you create an instance of the subclass, the counter will not increase (problem 1). Instead, the counter only increments once when you define your subclass (Problem 2).
JavaScript , , , . , ( ). , JavaScript (. JavaScript, Backbone, CoffeScript ..), , (IE6-8). :
SedanCar.prototype = Object.create(Car.prototype)
. . , (Java ..). JavaScript , :
var SedanCar = function () {
Car.call(this )
};
this, . , . , .