localStorage is synchronous. That one word explains a lot. Every getItem and setItem call blocks JavaScript execution until it completes. For small reads, you'll never notice. But inside loops, on ...