// Create a test Headers object
const myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.append("Vary", "Accept-Language");
// Display the key/value pairs
for (const pair of myHeaders.entries()) {
console.log(`${pair[0]}: ${pair[1]}`);
}Headers: entries() method / notebook
Headers: entries() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.