What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-22 19:11:02
clone object in js
var student = {name: "Rahul", age: "16", hobby: "football"}; //using ES6 var studentCopy1 = Object.assign({}, student); //using spread syntax var studentCopy2 = {...student}; //Fast cloning with data loss var studentCopy3 =... Add solution -
Javascript 2021-09-18 17:40:02
clone javascript object
var student = {name: "Rahul", age: "16", hobby: "football"}; //using ES6 var studentCopy1 = Object.assign({}, student); //using spread syntax var studentCopy2 = {...student}; //Fast cloning with data loss var studentCopy3 =... Add solution -
TypeScript 2021-09-17 02:11:02
Javascript:
/* Spread syntax ( ex. ...arrayName) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) elements (for array literals) are expected, or an object expression to be expanded ... Add solution -
Javascript 2021-09-16 02:01:02
clone aJavaScript object
var student = {name: "Rahul", age: "16", hobby: "football"}; //using ES6 var studentCopy1 = Object.assign({}, student); //using spread syntax var studentCopy2 = {...student}; //Fast cloning with data loss var studentCopy3 =... Add solution -
Javascript 2021-09-08 02:05:02
object javascript append
// Spread syntax allows an iterable (in this case an object) to be expanded const originalObj = { name: 'John', age: 34 } let newObj = { ...originalObj, city: 'New York' } // newObj is now { name: 'John', age: 34, city: 'New York' } // it can also be us... Add solution -
Javascript 2021-09-04 00:59:01
javascript ellipsis
function sum(x, y, z) { return x + y + z; } const numbers = [1, 2, 3]; console.log(sum(...numbers)); // expected output: 6 console.log(sum.apply(null, numbers)); // expected output: 6 /* Spread syntax (...) allows an iterable such as an array expres... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5