Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----- BROWSER -------
- ------- USER NORMAL -------
- console.log(window.localStorage.getItem("user"))
- {"image":"https://scontent.xx.fbcdn.net/hprofile-xfa1/v/l/t1.0-1/c0.0.50.50/p50x50/31…016898341_1083083452_n.jpg?oh=29f1c127a4a480fd1a6e9d2981983895&oe=56962185","user_id":"893479594077576","name":"Filipe Oliveira","email":"filipe.jtoliveira@gmail.com","type":"Facebook","last_Login":"2015-09-29T22:45:56.204Z"}
- console.log(typeof window.localStorage.getItem("user"));
- string
- app.js:122 ------- USER STRINFGY -------
- console.log(JSON.stringify(window.localStorage.getItem("user")));
- "{\"image\":\"https://scontent.xx.fbcdn.net/hprofile-xfa1/v/l/t1.0-1/c0.0.50.50/p50x50/31…16898341_1083083452_n.jpg?oh=29f1c127a4a480fd1a6e9d2981983895&oe=56962185\",\"user_id\":\"893479594077576\",\"name\":\"Filipe Oliveira\",\"email\":\"filipe.jtoliveira@gmail.com\",\"type\":\"Facebook\",\"last_Login\":\"2015-09-29T22:45:56.204Z\"}"
- console.log(typeof JSON.stringify(window.localStorage.getItem("user")));
- string
- ---- Funcionando no browser ----
- JSON.parse(window.localStorage.getItem("user"));
- type Object
- {image: "https://scontent.xx.fbcdn.net/hprofile-xfa1/v/l/t1…g?oh=29f1c127a4a480fd1a6e9d2981983895&oe=56962185", user_id: "893479594077576", name: "Filipe Oliveira", email: "filipe.jtoliveira@gmail.com", type: "Facebook"…}
- ----------- DEVICE ---------------
- ------- USER NORMAL -------
- window.localStorage.getItem("user)
- Objeto
- typeof: String
- ------- USER STRINGIFY -------
- Json.stringify(window.localStorage.getItem("user"))
- Object
- typeof: String
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement