当前位置:网站首页>Object.assign() 对象合并和Object.keys()获取对象名
Object.assign() 对象合并和Object.keys()获取对象名
2022-06-21 05:29:00 【weixin_38673922】
一、Object.assign() 对象合并
说明:js合并对象(第一个参数是源对象,后边的对象是目标对象,若源对象中有同名的参数,后合并的属性(方法)会覆盖之前的同名属性(方法))
var obj1 = {
name:'zs'}
var obj2 = {
age:18}
var obj3 = {
sex: '男'}
var newObj = Object.assign(obj1,obj2,obj3) //{name: 'zs', age: 18, sex: '男'}
二、Object.keys() 以数组的形式返回对象的属性名
var data = {
name:'zs',
age:18,
sex:'男',
}
Object.keys(data) //['name', 'age', 'sex']
边栏推荐
- Improve the comprehensive quality of teachers and students in the concept of maker Education
- File contains vulnerability - allow_ url_ Fopen and allow_ url_ Include details
- 如何保证数据库和缓存双写一致性?
- Abbexa HSD11B2 antibody solution
- Global and Chinese markets for dual input K-type thermometers 2022-2028: Research Report on technology, participants, trends, market size and share
- 适配器模式Adapter
- Excel dynamic chart
- Steam education subject integrates the intelligent scene of AR
- Glycosylated albumin research - abbexa ELISA kit to help!
- Blog forum system based on ssm+mysql+layui
猜你喜欢

Latex adds a strikeout (horizontal line) to the entire row of the table

A comprehensive interpretation of the gold content, detailed introduction and test strategy of CKA certification

Mac NAMP Pro comes with MySQL 5.7 setup SQL_ Model remove only_ FULL_ GROUP_ Invalid by may be caused by:,

Privacy sandbox helps enterprises: how privacy technology protects user data and promotes business growth
![[UVM basics] seed value setting in makefile](/img/23/4a735ca13ac9a8bddbe5f92c23b93e.jpg)
[UVM basics] seed value setting in makefile

Error 1030 (HY000): got error 168 from storage engine

Physical principle of space design in maker Education

面试题_V1.0

Simple summary of recommendation system combined with knowledge map

如何保证数据库和缓存双写一致性?
随机推荐
renren-fast启动提示 process.env.NODE_ENV
At the codeless Explorer conference, Qingliu invites you to discuss the way of digital transformation practice
In depth analysis of short URL Technology
Online ordering system based on ssm+mysql+hui+ wechat applet
@GetMapping,@PostMapping,@ApiOperation,@ApiParam,@ApiImplicitParams
《微型Lisp解释器的构造与解释》的写作风格
常見的存儲類型
MyBaits-plus
Record of error prone problems in PHP signature
MAC MAMP PRO 安装PHP扩展方法
Idea debug occurs: skipped breakpoint at because it happened inside debugger evaluation
Build opencv3.4.16
C语言:随机输入每位同学中每门学科的成绩,要求每位同学的所有学科平均分从低到高排序求出每位同学的平均成绩后,再进行判断该同学的平均成绩是否达到及格。
基于SSM+MySQL+LayUI+JSP的公共交通运输信息管理系统
Common request methods and request header parameters
Welcome the golden age of maker education + Internet
Comprehensive arrangement of character recognition methods
Abbexa GM130 antibody solution
Automobile maintenance management system based on ssm+bootstrap+mysql+thymeleaf
@GetMapping,@PostMapping,@ApiOperation,@ApiParam,@ApiImplicitParams