Johnathan Sewell
Johnathan Sewell

Reputation: 759

What does the Backbone.js extend function do?

I understand it is providing static or "class" properties, but I want to understand how it's doing this, is it creating a new object and putting these static properties on the prototype?

Backbone.View.extend(properties, [classProperties])

Upvotes: 3

Views: 505

Answers (1)

davidpfahler
davidpfahler

Reputation: 606

Backbone used and internal helper function called inherits. You can see the annotated source code here. It sets up the prototype chain to provide class-like functionality.

Upvotes: 2

Related Questions