I'm making a very simple book listing app that is supposed to use localStorage. I have an array of Book objects (using the ES6 class) which is then saved to localStorage using JSON.stringify().
let array = [
//has Book objects
];
//Book class
class Book {
constructor(title, author, link, pages) {
this.title = title;
this.author = author;
this.link = link;
this.pages = pages;
this.isRead = false;
}
}
//saves the array whenever user adds a book listing
function addBook(book, array) {
array.push(book);
window.localStorage.setItem("library", JSON.stringify(array));
}
When I view the content of local storage, it has three additional, unexpected values such as :
darkyMode: "1"
darkyState: "f"
darkySupported: "t"
library: //my array of books
[value of localStorage][1] [1]: https://i.stack.imgur.com/f8HRS.png
I want to remove these additional values and prevent them from appearing if possible. Is this normal in javascript? I use bootstrap, and plain JS, if it helps.
I guess it's from my night eye extension as stated by @robertklep. Thanks guys.