0
Q:

how to get json file in javascript

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

New to Communities?

Join the community