What is the meaning of the three-point expansion here in es6?

what does es6 mean by the three-point expansion here? Answer by the great god. Can I post online materials? what I have seen by myself does not have this way of writing. It is all written by you who answer questions.

Feb.21,2022

this is a feature of es6 and is mainly used for the deconstruction of arrays and objects. The sample code is as follows:

// es6 
const App = {
    name:'323',
    age:1
}
const C = {
  ...App,
  title:'dsd'
}

// babel es5:
'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; iPP) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var App = {
  name: '323',
  age: 1
};

var C = _extends({}, App, {
  title: 'dsd'
});
The final result of

/ / C is

.
{
  name: '323',
  age: 1,
  title: 'dsd'
}

  1. let arr = [1, 2, 3], then you can use [.arr, 4, 5, 6].
  2. can be used to stitch objects:
let obj = {
    name: 'name'
}
let newObj = {
    ...obj,
    age: 18
}
// 
{
    name: 'name',
    age: 18
}

specific references


this is the ES6 deconstruction assignment. You can find out

by looking it up.
Menu