Comment

Comment by elbasti

As a JS dilettante, I found this incredibly surprising.

    const data = { foo: 42, bar: 1337 }; // 
>>> can be represented in JSON-stringified form, and then JSON-parsed at runtime:

    const data = JSON.parse('{"foo":42,"bar":1337}'); // 
>>> As long as the JSON string is only evaluated once, the JSON.parse approach is much faster compared to the JavaScript object literal, especially for cold loads.
parent elbasti 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton