Seprate operator (...name)

 with the help of seprate operator we can get array element in other array element

const fullname = ["biplav","mazumdar"];

const bio = [12,...fullname,"cars","Bmw"]

console.log(bio);

[ 12, 'biplav', 'mazumdar', 'cars', 'Bmw' ] This is the output

///////////////////////////////////


var Ful = ["BMW","Ferari","RR","Lamborghani"]
var [first,...rem] = Ful;

console.log(first);
console.log(rem);

BMW [ 'Ferari', 'RR', 'Lamborghani' ] This is output

///////////////////////////////////

var Ful = {name:"BMW",car:"Ferari",Brand:"RR",City:"Lamborghani"}
var bio= {Home:"lamb",...Ful};

console.log(Ful);
console.log(bio);


This is output

{ name: 'BMW', car: 'Ferari', Brand: 'RR', City: 'Lamborghani' } { Home: 'lamb', name: 'BMW', car: 'Ferari', Brand: 'RR', City: 'Lamborghani' }

Comments