This project is to follow along with the book and practice the examples within it. Rediscovering JavaScript explores the new features of JavaScript and how to use them effectively.
JavaScript Gotchas This chapter demonstrates common JavaScript pitfalls. When working within JavaScript it's good to know existing pitfalls and how to overcome them.
Variables and Constants
This chapter demonstrates the issues with JavaScripts var
and how they can be overcomed with the new let
and const
types.
This chapter demonstrates the improvements to JavaScripts functions to allow for arrow functions and spread parameters.
This chapter goes over the new iternation patterns which are more concise and less noise. The new interface like primitive type called 'Symbol'. Generators and how they can help create infinite sequences.
Anonymous functions have been in JavaScript from day one. Arrow functions are new and declutter the code and make the code more expressive. Arrow functions are NOT a direct replacement for anonymous functions. Arrow functions can promote functional style programming and its benefits.
In this chapter we look at new features within JavaScript to reduce noise and clutter within code. Template literals, multiline strings, object literals, and destructing are new ways to reduce the code clutter and improve readability and ease of coding.
It is now possible to create clean Object Oriented code with JavaScript. JavaScript now allows for a new way of creating classes, instances and static members. Within the new improvements we will be able to create clean and less error prone classes Object Orient programming with a ix of functional programming.
JavaScript implements prototypal inheritance. The synytax for inheritance is now much easier to use and understand.It brings an updated syntax for inheriting from an existing classes.
JavaScript modules are well-encapsulated files. Modules all for cohesive software designs as it allows for clearly specifiying what is needed via imports and what can be used by others via exports. This control prevents accidental and unintentional dependencies in code and reduces errors. Javascript modules allow for big applications to be broken down into well structured parts.
Modern JavaScript promises replace callbacks for asynchronous programming. Promises are nonblocking and will eventually return a result or an error to the caller through the promise. Promises are a lot easier to work with compared to calbacks. Their structure is a lot like functional style programming. With promises it is easier to propagate errors and recover from them as well.
Metaprogramming is a way to extend a program at runtime; it is the ability to write code that writes code. It is one of the most complex and new futures of JavaScript. Metaprogramming has two styles: member injection and member synthesis. Member injection is useful to add well-lknow methods to existing classes. Metaprogramming is quite powerful, but you have to be very careful when using it.
Method synthesis is the most powerful form of metaprogramming. It can alter the API and the behavior of objects based on the runtime context and state of the objects. Method synthese is a recent feature in JavaScript. It introduces two new classes Relfect and Proxy, which with method synthesis can help code become incredibly extensible.