Console Learner — An interactive JavaScript course.


5.6 Further Reading

Lots of topics have been omitted from this course. Here are a few important ones:

Language & Standard Library Reference

The Mozilla JavaScript Reference has been used throughout this course, as it has been a reliable and up-to-date reference for a long time. Make sure to also check their reference pages for other web technologies and browser API:s.

Debugging & Logging

Most browsers have built-in developer tools for JavaScript now. These all support logging via the console.log() API. A number of services are available for remote logging, i.e. sending the log output and browser errors to a remote server.

Performance Myths

There are lots poor recommendations and myths for optimizing JavaScript performance. Most such advice should just be ignored.

The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.

If your code has real performance issues, you or your users will notice. Make sure to use a profiler and benchmark any optimization before blindly following anyones advice.

Memory & Garbage

JavaScript is a garbage collecting language, so memory is mostly handled automatically. But note that the HTML DOM objects (wrapping web page elements) are very prone to cause memory leaks, i.e. memory that cannot be reclaimed by the garbage collector. Use profiling to find these if it becomes an issue and avoid the following:

Legacy Browsers

Legacy browser support has been a recurring headache for any web technology, including JavaScript. Nowadays, extensive feature and API compatibility data is available both from Mozilla JavaScript Reference and caniuse.com. And modern tools like Babel and others provide support for transpilation and polyfills to allow writing source code that takes advantage of the most recent language features.

Minification

Since JavaScript is executed in web browsers, some efficiency and protection advantages can be had by minification of the source code. The available tools have varied greatly over the years. But at the time of this writing (2023), using esbuild or swc seems like great choices.

Security

The topic of web browser security is large and better explained elsewhere. Worth noting here though, is that JavaScript does not provide any particular security mechanisms. Any code that is imported into a web page (e.g. via the <script> element) is granted full access to the global scope variables, HTTP cookies and more. This requires a high degree of trust.

The console allows you to interact with the course material and examples. Use the following keys:

A special logging function is also available:


Need more magic? Check out the other developer tools on this site.