What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-05 23:49:03
req an external server using node
const https = require('https'); https.get('https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY', (resp) => { let data = ''; // A chunk of data has been received. resp.on('data', (chunk) => { data += chunk; }); // The whole response... Add solution -
Javascript 2021-09-05 04:13:02
using javascript when i ' m iterate localstorage current input value my DOM its Add multiple value or perivous value of localstorage ?
//featch data from form // class Book{ // constructor(givenNAme , givenAuthor , givenType){ // this.name = givenNAme; // this.author = givenAuthor; // this.type = givenType; // } // } // display function class Display {... Add solution -
-
Javascript 2021-08-30 21:27:02
save json object in localstorage javascript
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 2021-08-30 12:27:01
local storage javascript object
var person = { "name": "billy", "age": 23}; localStorage.setItem('person', JSON.stringify(person)); //stringify object and store var retrievedPerson = JSON.parse(localStorage.getItem('person')); //retrieve the object Add solution -
Other 2021-08-29 21:56:02
how to decode jwt token client side
let b64DecodeUnicode = str => decodeURIComponent( Array.prototype.map.call(atob(str), c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2) ).join('')) let parseJwt = token => JSON.parse( b64DecodeUnicode( token.... Add solution -
Javascript 2021-08-29 16:12:02
Reading JSON from localStorage
type Result = | { success: true, value: unknown } | { success: false, error: Error }; function tryDeserializeLocalStorageItem(key: string): Result { const item = localStorage.getItem(key); if (item === null) { // The item does not exist, thu... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5