Skip to content

Instantly share code, notes, and snippets.

@secretgspot
Created November 23, 2019 05:47
Show Gist options
  • Save secretgspot/4d709b486f423e42dff6c2562ca53acf to your computer and use it in GitHub Desktop.
Save secretgspot/4d709b486f423e42dff6c2562ca53acf to your computer and use it in GitHub Desktop.
// https://www.youtube.com/watch?v=ff4fgQxPaO0
/*
Because the JSON grammar is much simpler than JavaScript’s grammar, JSON can be
parsed more efficiently than JavaScript. This knowledge can be applied to improve
start-up performance for web apps that ship large JSON-like configuration object
literals (such as inline Redux stores).
*/
const data = { foo: 42, bar: 1337 }; // 🐌
// ..is equalent to:
const dataTwo = JSON.parse('{ "foo": 42, "bar": 1337 }'); // 🚀
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment