Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using jsfiddle: how can I use underscore.js or backbone.js libraries?

In jsfiddle is possible to use for example jQuery.
But I cannot see any references, for example, to underscore or backbone.js.

If I run this demo I get the error:

Uncaught ReferenceError: _ is not defined 

How can I use underscore.js or backbone.js libraries in jsfiddle?

like image 670
underscore666 Avatar asked Apr 30 '12 09:04

underscore666


People also ask

How do you use underscore in JavaScript?

Adding Underscore to a Node. Once added, underscore can be referred in any of the Node. js modules using the CommonJS syntax: var _ = require('underscore'); Now we can use the object underscore (_) to operate on objects, arrays and functions.

What is underscore library js?

js is a JavaScript library which provides utility functions for common programming tasks. It is comparable to features provided by Prototype. js and the Ruby language, but opts for a functional programming design instead of extending object prototypes. The documentation refers to Underscore.

Do you need underscore js?

Underscore ( _ ) is just a plain valid character for variable/function name, it does not bring any additional feature. However, it is a good convention to use underscore to mark variable/function as private. You can check Underscore prefix for property and method names in JavaScript for some previous discussion.


1 Answers

Add the URL for the required library under the "Add Resources" button on the left hand side.

See http://jsfiddle.net/alnitak/BwHxv/

like image 78
Alnitak Avatar answered Nov 15 '22 19:11

Alnitak