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 8605719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:54:32+00:00 2026-06-12T02:54:32+00:00

If I try it like $.extend(function_arguments, defaults_arguments) not all of the default_arguments get overwritten.

  • 0

If I try it like

$.extend(function_arguments, defaults_arguments)

not all of the default_arguments get overwritten. For example if one of them is a function (this), it will remain in the object if the one from the function_arguments is of different type…

What does $.extend do exactly? Shouldn’t it work like array_merge, but for objects?


ok, to be more clear:

....function(args){


  $.extend(args, {
     // here are defaults
     foo: this,
     abc: 1
  });

}

for some reason i get the default value for “foo”, even if I have it inside args…

If I reverse the objects, like:

....function(args){


  $.extend({
     // here are defaults
     foo: this,
     abc: 1
  }, args);

}

I get only the properties from args, the defaults are missing completely 😐

  • 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-06-12T02:54:34+00:00Added an answer on June 12, 2026 at 2:54 am

    There’s a perfect example on the jQuery Documentation : jQuery.extend

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

Sidebar

Related Questions

I have a model which looks like this: //myModel.js define([], function () { var
I have some code to update a database table that looks like try {
I would like to try Silex but i've some questions. I know to use
I'd like to try out different regexes for the formatlistpat option. Any suggestions as
I would like to try to assign a variable value to input hidden field
I would like to try some image filter features on iPhone like instagram does.
I'd like to try out a distributed revision control system. I use a couple
I'd like to try Vim. I'm using Mac OS 10.6.2 (Snow Leopard). I downloaded
I'd like to try out OpenGL programming in Scheme. Can anyone give a recommendation
I'd like to try the plugin for Vim linked below. It adds syntax highlighting

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.