Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to store and extract local storage

let p1 = new Point(1,2);
let p2 = new Point(4,8);
let p3 = new Point(3,7);
// create a polygon using an array containing p1, p2, p3
let poly1 = new Polygon([p1,p2,p3]);

// store in local storage
localStorage.setItem("poly1",JSON.stringify(poly1));

// retrieve into new variable
let poly1Data = JSON.parse(localStorage.getItem("poly1"));
Comment

PREVIOUS NEXT
Code Example
Javascript :: express get slash value 
Javascript :: Transform raw text to links 
Javascript :: sum of array odd number javascript 
Javascript :: react prototype function 
Javascript :: js regex to find string but not another 
Javascript :: feathersjs quicstart 
Javascript :: node-google-spreadsheet color border 
Javascript :: nodejs postgresql scalar query 
Javascript :: cli run js 
Javascript :: jquery clear chozen 
Javascript :: wordpress apostrophe problem in javascript 
Javascript :: android studio react native plugins 
Javascript :: mdns javascript 
Javascript :: what is download api javascript 
Javascript :: selenium python grid configuration json 
Javascript :: dynamic select paragraph id using javascript 
Javascript :: data in table when i click the table link in open table in another jquery 
Javascript :: javascript arrays codeburst 
Javascript :: jquery live notification 
Javascript :: javascript path folder above 
Javascript :: locak storage for table js 
Javascript :: smaler div on devices 
Javascript :: reference self in ajax callback 
Javascript :: cannot find name json angular 7 
Javascript :: lemon get node from id 
Javascript :: reverse a number in javascript without using inbuilt function 
Javascript :: how to get 3rd level form data by $refs in vue 
Javascript :: telegraf force_reply 
Javascript :: how to access match object in class component 
Javascript :: get selected value on componentdidmount reactjs 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =