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

Sending Binary Data over the Network with Json