-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This repository is part of a larger project!
The keyword new could be used to execute a constructor function.
Forgetting keyword new should not lead to an error unless strict mode is used. The result using no strict mode would be global variables if those are instanced with this.
Also an alternative could be used as found in the file "new.js" within the function alternative.
The user interaction part should look like the content as seen below by starting "index.html" in a web browser.
🅱️ utton "NO STRICT" should show what could happen if keyword new is forgotten.🅱️ utton "STRICT" should show an error within the chrome`s console.🅱️ utton "ALTERNATIVE" should show a way how to catch a situation when forgetting the keyword new.
To use the project just download the files and execute "index.html". Note that all files(folder "wiki_images" excluded) should be placed in the same folder so that the functionality of the code is guaranteed.
This knowledge was gained:
- Effective JavaScript "68 Specific Ways to Harness the Power of JavaScript" by David Herman
Sources: