Below data, call the fetch() function. Pass it url as its first argument and an empty object as its second argument. code example
Example: fetch api javascript
fetch('http://example.com/songs')
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));