javascript read json file

JavaScript
// Use the Fetch API & ES6
fetch('data.json')
  .then(response => response.json())
  .then(data => {
  	// Do something with your data
  	console.log(data);
  });const fs = require('fs');
const path = require('path');

let rawdata = fs.readFileSync(path.resolve(__dirname, 'student.json'));
let student = JSON.parse(rawdata);
console.log(student);"add variable to the .json file"
const data = require('./filename')
"Then get the array from the file with a ."
"EXAMPLE"
const MyLists = require('./MemeBotLists.json')
console.log(Mylists.Memes)
"it should then put all members of the array in the logs"
Source

Also in JavaScript: