How to do it...

  1. Open your command-line application and navigate to your workspace.
  2. Create a new folder named 06-02-object-entries-to-get-iterable.
  3. Copy or create an index.html that loads and runs a main function from main.js.
  4. Create a main.js with a function named main that creates an object then uses a for-of loop to loop over the result of Object.entries:
// main.js 
export function main() { 
  const object = { 
    foo: Math.random(), 
    bar: Math.random() 
  }; 
  for (let [prop, value] of Object.entries(object)) { 
    console.log(prop, value); 
  } 
} 
  1. Start your Python web server and open the following link in your browser: 
    http://localhost:8000/.
  1. You will see the following output:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.76.7