Skip to content

Instantly share code, notes, and snippets.

@pannet1
Created January 30, 2022 16:40
Show Gist options
  • Save pannet1/1164f43295603835996ae4bcbfd8721e to your computer and use it in GitHub Desktop.
Save pannet1/1164f43295603835996ae4bcbfd8721e to your computer and use it in GitHub Desktop.
// contents of NIFTY.json
[
17861.5,
17890,
17613.15,
17900
]
// index.js begins
const get_prediction = () => {
pre = fetch('./NIFTY.json')
.then((response) => {
response.json();
})
.then((data) => {
return data;
});
return pre
}
// following should return the array stored in the json file
pre = get_prediction()
console.log(pre)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment