- Open your command-line application and navigate to your workspace.
- Create a new folder named 06-02-object-entries-to-get-iterable.
- Copy or create an index.html that loads and runs a main function from main.js.
- 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); } }
- Start your Python web server and open the following link in your browser: http://localhost:8000/.
- You will see the following output: