mirror of
https://github.com/github/codeql.git
synced 2026-02-08 11:11:06 +01:00
15 lines
294 B
JavaScript
15 lines
294 B
JavaScript
async function getData(id) {
|
|
let req = await fetch(`https://example.com/data?id=${id}`);
|
|
if (!req.ok) return null;
|
|
return req.json();
|
|
}
|
|
|
|
async function showData(id) {
|
|
let data = await getData(id);
|
|
if (data == null) {
|
|
console.warn("No data for: " + id);
|
|
return;
|
|
}
|
|
// ...
|
|
}
|