You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
const [first, ...restOfItems] = [10, 20, 30, 40];
|
|
|
|
const data = {
|
|
temp1: '001',
|
|
temp2: '002',
|
|
firstName: 'John',
|
|
lastName: 'Doe',
|
|
};
|
|
|
|
const { temp1, temp2, ...person } = data;
|
|
|
|
const newArray = [...restOfItems];
|
|
|
|
const newObject = {
|
|
...person,
|
|
};
|