Top "Underscore.js" questions

Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.

Remove empty properties / falsy values from Object with Underscore.js

I have an object with several properties. I would like to remove any properties that have falsy values. This can …

javascript arrays object underscore.js
underscore contains (_.contains) on object types

I'm just getting started with Javascript and using the Underscore library. I see they have all sorts of utility function, …

javascript underscore.js
Loading Backbone and Underscore using RequireJS

I'm trying to load Backbone and Underscore (as well as jQuery) with RequireJS. With the latest versions of Backbone and …

javascript backbone.js underscore.js requirejs
Convert returned JSON Object Properties to (lower first) camelCase

I have JSON returned from an API like so: Contacts: [{ GivenName: "Matt", FamilyName: "Berry" }] To keep this consistent with my …

javascript jquery json lodash underscore.js
Is there any way to rename js object keys using underscore.js

I need to convert a js object to another object for passing onto a server post where the names of …

javascript jquery underscore.js
Filter backbone collection by attribute value

I have a defined model and a collection: var Box = Backbone.Model.extend({ defaults: { x: 0, y: 0, w: 1, h: 1, color: "black" } }); …

backbone.js underscore.js backbone.js-collections
lodash Filter collection using array of values

I would like to filter a collection using array of property value. Given an array of IDs, return objects with …

underscore.js lodash
Reduce array to a single string

I would like to use the reduce function instead of doing this: var result = ''; authors.forEach( function(author) { result += …

javascript underscore.js
Get an object from array which contains a specific value

I am trying to search through an array of objects using Underscore.js, but I can't seem to target the …

javascript underscore.js
JavaScript merging objects by id

What's the correct way to merge two arrays in Javascript? I've got two arrays (for example): var a1 = [{ id : 1, name : "…

javascript arrays underscore.js