Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
JavaScript localStorage has unexpected values

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I guess it's from my night eye extension as stated by @robertklep. Thanks guys.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!