- Open your command-line application, and navigate to your workspace.
- Create a new folder named 12-01-add-remove-from-set.
- Copy or create an index.html that loads and runs a main function from main.js.
- Create a main.js file that defines a main function. In that function, create a new Set instance, then add and remove a few items from it:
// main.jsexport function main() { const rocketSet = new Set(); rocketSet.add('US: Saturn V'); rocketSet.add('US: Saturn V'); rocketSet.add('US: Falcon Heavy'); console.log(rocketSet); rocketSet.delete('US: Falcon Heavy'); console.log(rocketSet);}
- Start your Python web server, and open the following URL in your browser: http://localhost:8000/.
- You will see the following output: