- Open your command-line application and navigate to your workspace.
- Create a new folder named 06-09-create-objects-with-structuring.
- Copy or create an index.html that loads and runs a main function from main.js.
- Create a main.js file with an async function named main, which creates several constants and then uses object structuring to create an object with properties of the corresponding names and values:
// main.jsexport function main() {
const prop1 = 'some value';
const prop2 = 'some other value';
const objectProp = { foo: 'bar' };
const object = { prop1, prop2, objectProp };
console.log(object);
}
- Start your Python web server and open the following link in your browser: http://localhost:8000/.
- You should see the following ...