I am new to Advance js and don't know much about it. I want to use fetch api of js to get data from a text file.
fetch('http://example.com/movies.json')
.then(response => response.text())
.then(data => console.log(data));
i want to store fetched data in a variable. please help me