Clone object in JavaScript

Object.assign() is a method which is used for cloning an object in JavaScript. Here is an example
 
var person = { talk: "true" };
var male = Object.assign({}, person);

Comments

Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Difference between Validations, Callbacks and Observers