This extend() Method in jQuery is used to merge the contents of two or more objects together into the first object.
jQuery.extend( [deep ], target, object1 [, objectN ] )
Parameters: The extend() method accepts four parameter that is mentioned above and described below:
- deep: This parameter is the merge becomes recursive .
- target: This parameter is the object to extend. It will receive the new properties.
- object1: This parameter is the object containing additional properties to merge in.
- object1: This parameter is an additional objects containing properties to merge in.
Return Value: It returns the object after merging.
Below examples illustrate the use of extend() method in jQuery:
Example 1: In this example, the extend() method merge two objects in one.
Example 2: In this example, the extend() method merge two objects, without modifying any object.
- jQuery.fn.extend() Method
- @include vs @extend in SASS
- Underscore.js | _.extend() Function
- Sass @extend Rule
- jQuery | jQuery.fx.interval Property with example
- jQuery | jQuery.fx.off Property
- jQuery | jQuery.support Property
- jQuery | jquery Property
- jQuery UI | position() Method
- JQuery | parseHTML() method
- jQuery | css() Method
- jQuery | add() method with Example
- jQuery | not() method with Examples
- jQuery | ajaxStart() Method
- JQuery UI | Progressbar method
- jQuery | get() Method
- jQuery | fadeIn() Method
- jQuery | delegate() Method
- jQuery | outerHeight() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.