Skip to content

功能跟jQuery.extend基本一直,唯一区别是,extend2 针对 array 类型数据,是采用覆盖赋值方式

License

Notifications You must be signed in to change notification settings

aiv367/jquery.extend2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jquery.extend2

功能跟jQuery.extend基本一致,唯一区别是,extend2 针对 array 类型数据,是采用覆盖赋值方式,而不是追加合并方式。

引入

<script src="./jquery.min.js"></script>
<script src="../src/jquery.extend2.js"></script>

示例

let a = {
	data: [1, 2, 3]
};

let b = {
	data: [4, 5, 6]
};

let c =  $.extend2(true, a, b);

//结果
c = {
	data: [4, 5, 6]
}

//如果是原始jquery.extend 方法会返回下面结果
c = {
	data: [1, 2, 3, 4, 5, 6]
}

About

功能跟jQuery.extend基本一直,唯一区别是,extend2 针对 array 类型数据,是采用覆盖赋值方式

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published