What is JSON Used For in JavaScript Programming?
JSON (JavaScript Object Notation) is a common file format used to store data instead of alternatives like XML or YAML. JSON is popular because it works natively with JavaScript and Python.
What is JSON?
My first exposure to JSON files was in setting up a .prettierrc
configuration file to format my files with Prettier in a Codesandbox.io project that I was working on last year. Since my background is in bioinformatics, I instantly realized that JSON files were simply a type of data storage, where text represented certain types of data.
However, I didn’t immediately realize the close connection between JSON and JavaScript objects. JSON is a special file format that can instantly be converted to a JavaScript object using JSON.parse()
and then converted back to a JSON file using JSON.stringify()
.
JSON is commonly used for configuration files, but it can be used to store almost any JavaScript object as a text file. In this article, I’ll explain the basics of how to work with the JSON format and why JSON is popular with JavaScript programmers.
What does JSON Stand For?
“JSON (JavaScript…