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

  • SEARCH
  • Home
  • 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 7580403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:54:32+00:00 2026-05-30T17:54:32+00:00

jQuery’s extend function has the option of recursive extension, which I use when creating

  • 0

jQuery’s extend function has the option of recursive extension, which I use when creating json config files. I can see that underscore has an extend function, but it doesn’t even mention recursion. I assume this means it doesn’t recursively extend, but I thought I’d ask here before implementing it into my project and wasting a lot of time.

  • 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-30T17:54:33+00:00Added an answer on May 30, 2026 at 5:54 pm

    Your assumption is correct, Underscore’s extend does not recursively extend. The implementation is rather simple:

    _.extend = function(obj) {
      each(slice.call(arguments, 1), function(source) {
        for (var prop in source) {
          obj[prop] = source[prop];
        }
      });
      return obj;
    };
    

    The most interesting part for you is what’s inside the for loop, a simple non-recursive assignment:

    obj[prop] = source[prop];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jQuery's getScript function doesn't seem to support an error callback function. I can't use
Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
jQuery.extend( jQuery.jgrid.edit, { ajaxEditOptions: { contentType: application/json }, //form editor reloadAfterSubmit: true // afterSubmit:
JQuery's sortable has an option to revert the item that the user drags back
jQuery(document).ready(function ($) { $('body').keypress(function (e) { alert(e.which); }); }); This will pop up an
jQuery's AJAX error function has the following parameters: error(XMLHttpRequest, textStatus, errorThrown) What's the best
jQuery has a really handy event binder called live() which will add events to
jQuery(document).ready(function () { $lstAccountType = $('select[id*=account_type]'); $lstAccountType.change(function () { $(this).remove('option[text=select one]') }); }); I
jQuery has opacity correction when you use css method (lines 4592-4608 on jQuery 1.4.2):
jQuery UI Sortable + Draggable 1.6rc5 WHAT I AM DOING: Creating a calendar with

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.