is fetch api safe to use code example
Example: How to use fetch api
async function fetchText() {
let response = await fetch('/readme.txt');
let data = await response.text();
console.log(data);
}Code language: JavaScript (javascript)
async function fetchText() {
let response = await fetch('/readme.txt');
let data = await response.text();
console.log(data);
}Code language: JavaScript (javascript)