Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "_" means here?

I am learning backbone.js, in it's tutorial, it has the following code

var object = {}; _.extend(object, Backbone.Events); ... 

I don't understand the "_" in the code, what does it means? and what is this "extend"? does it has the same meaning as jQuery.extend ?

like image 324
Mellon Avatar asked Mar 24 '11 11:03

Mellon


People also ask

What does here mean in the Dictionary?

Webster Dictionary(0.00 / 0 votes)Rate this definition: Here Here(noun) hair Here Here Here(adverb) in this place; in the place where the speaker is; -- opposed to there Here(adverb) in the present life or state Here(adverb) to or into this place; hither. Here(adverb) at this point of time, or of an argument; now

What is the meaning of here goes?

here goes. —used interjectionally to express resolution or resignation especially at the beginning of a difficult or unpleasant undertaking. neither here nor there. : having no interest or relevance : of no consequence comfort is neither here nor there to a real sailor. here.

What does it mean when someone says neither here nor there?

—used interjectionally to express resolution or resignation especially at the beginning of a difficult or unpleasant undertaking. — neither here nor there. : having no interest or relevance : of no consequence. comfort is neither here nor there to a real sailor.

What does “…” mean in text?

Mean In Text? Here’s The Answer & How To Respond (21 Examples) “…” in text shows just how mailable language is. If we read “…” in a book, it’s clear what it means, it’s just a long pause to build suspense. But in text, themeaning changes, and to make things even more confusing, even in text “…” doesn’t always have the same meaning.


Video Answer


2 Answers

From Backbone's own homepage :

Backbone's only hard dependency is Underscore.js.

_ is the object created by Underscore.js, in the same way as $ is the jQuery object

http://documentcloud.github.com/underscore/#extend as for what _.extend does.

like image 185
Bruno Rohée Avatar answered Oct 08 '22 22:10

Bruno Rohée


It copies all the Backbone.Events properties over to the object. Extend is a method from the underscore library: http://documentcloud.github.com/underscore/#extend

I'd say it's the same as the jQuery method.

like image 24
benvds Avatar answered Oct 09 '22 00:10

benvds