how to clone an object

JavaScript
const first = {'name': 'alka', 'age': 21} 
const another = Object.assign({}, first);//coning using spread operator 
const first = {'name': 'alka', 'age': 21} 
const another = {...first }
Source

Also in JavaScript: