Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7185981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:32:08+00:00 2026-05-28T18:32:08+00:00

For a web-app I’m building, I’m really interested in recursing through an object tree

  • 0

For a web-app I’m building, I’m really interested in recursing through an object tree and modifying nodes on the fly. There’s an underscore mixin that promises that, underscore.loop, but I can’t seem to pull it into my page. I get a script error:

Uncaught TypeError: Cannot call method ‘mixin’ of undefined

which is on line 33 of the tool.

Now, underscore.loop.js is pulled in after backbone.js and underscore-data.js.

  1. Both of these tools use Underscore, and
  2. Underscore is definitely available after trying underscore.loop.

So why can’t underscore.loop.js see Underscore. It uses pretty much the same scoping and initialization semantics as underscore-data.js. Can anyone shed any light on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:32:09+00:00Added an answer on May 28, 2026 at 6:32 pm

    Look a little higher in the source for underscore.loop and you’ll see this:

    var RecursiveCall, flatStackLoop, _;
    var __slice = Array.prototype.slice;
    try {
      _ = require('underscore');
    } catch (_e) {}
    

    Note the var ... _; and how _ is initialized. So underscore.loop.js is trying to make sure that underscore.js is loaded and that it has a local version of _ to use. require is a node.js-ism so you don’t have it in your client-side world and that leaves you with an undefined value in _. You can either grab a client-side library that supplies a node.js compatible require:

    • require.js
    • head.js
    • Lab.js
    • …

    or edit your copy of underscore.loop.js to not include the var _; declaration or the try block. Alternatively, you could hack up a little require implementation of your own that just does this:

    function require(what) {
        return what == 'underscore' ? window._ : null;
    }
    

    or even:

    function require(ignored) { return window._ }
    

    and load your require hack between underscore.js and underscore.loop.js.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a web app with jQuery & Rails. The web app loads pages
The web-app I'm currently building follows MVC. I've structured the servlets in a way
My web app generates a CSV file on the fly, but whenever I use
My web app has a left nav containing a tree grid. I'm hoping somebody
I am building a web app that utilizes groups, facebook groups, email list groups
My web app is going to call a webservice. I'm looking for best practices
A web app I'm working on requires frequent parsing of diverse web resources (HTML,
My web App prepares out of a db for one or two minutes a
Our web app needs to be made PCI compliant, i.e. it must not store
My web app solution consists of 3 projects: Web App (ASP.NET MVC) Business Logic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.