Dev HelpersOpen library
← Back

Es8 Es2017 · code 01

Preserved from the original JavaScript Field Guide. Some entries are React fragments that require the surrounding component.

Open this example in the interactive library

Source code

async function fetchData() {
  const response = await fetch('https://api.example.com/data');
  const data = await response.json();
  return data;
}

const person = {
  name: 'John',
  age: 30,
};

console.log(Object.entries(person));
// Output: [["name", "John"], ["age", 30]]