Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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])

like image 775
Johnathan Sewell Avatar asked Dec 08 '25 06:12

Johnathan Sewell


1 Answers

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.

like image 116
davidpfahler Avatar answered Dec 12 '25 11:12

davidpfahler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!