Skip to content

extend

主要用于对象合并,将源对象中的属性复制到目标对象中,他将返回目标对象。会改变target传参对象

添加版本

1.0.0

使用

html
<script setup>
  import { extend } from '@ryxon/utils'

  var target = { name: '带你飞' }
  var source = { age: 18 }
  var result = extend(target, source)
  console.log(result, target === result) // {name: '带你飞', age: 18} true
</script>

API

参数

参数说明类型默认值
target目标对象Object-
[sources]来源对象(...Object)-

Released under the MIT License.