D
D
Danil Chekalin2014-04-13 15:02:23
backbone.js
Danil Chekalin, 2014-04-13 15:02:23

Backbone, the extend function and how does it work?

Link to a piece of code backbonejs.org/docs/backbone.html#section-209
Gentlemen, explain how this piece of code works.

...
} else {
  child = function(){ return parent.apply(this, arguments); };
}

I don't understand how the child passed in _.extend(child, parent, staticProps);acts as an object and not a function, which also hasn't been executed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vit, 2014-04-13
@dakiesse

In Javascript, a function is also an object, you can do the same operations with it as with other objects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question