how to get json file in javascript

JavaScript
// Use the Fetch API & ES6
fetch('data.json')
  .then(response => response.json())
  .then(data => {
  	// Do something with your data
  	console.log(data);
  });"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: