Fetching a JSON file for posts XMLHttpRequest is used to fetch the JSON file. JSON.parse parses the JSON text into an array of post objects.