What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-02 17:41:22
clone an object javascript
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 2022-02-02 08:16:43
how to store objects in localstorage
var testObject = { 'one': 1, 'two': 2, 'three': 3 }; // Put the object into storage localStorage.setItem('testObject', JSON.stringify(testObject)); // Retrieve the object from storage var retrievedObject = localStorage.getItem('testObject'); console.lo... Add solution -
Javascript 2022-02-02 06:10:40
javascript fetch api get
//Obj of data to send in future like a dummyDb const data = { username: 'example' }; //POST request with body equal on data in JSON format fetch('https://example.com/profile', { method: 'POST', headers: { 'Content-Type': 'application/json', }, ... Add solution -
Other 2022-02-02 03:55:56
snppet for seeing output on screen
//Snippet for testing output in the front end, using material ui //Place your state in place of filters <Box> <Card> <CardHeader title="Output" /> <CardContent> <pre style={{ backgroundCol... Add solution -