[timestamp, url] = generateLatestDataUrl();
data = fetch(url)
.then(response => response.json())
.catch(error => {
console.error("Error fetching data:", error);
return null;
});
Promise.all([Promise.resolve(timestamp), data])
.then(([fetchedTimestamp, fetchedData]) => {
console.log("Timestamp:", fetchedTimestamp);
console.log("Data:", fetchedData);
})
.catch(error => {
console.error("Error:", error);
});