Book description
The best modern JavaScript is simple, readable, and predictable. Learn to write modern JavaScript not by memorizing a list of new syntax, but with practical examples of how syntax changes can make code more expressive. Starting from variable declarations that communicate intention clearly, see how modern principles can improve all parts of code. Incorporate ideas with curried functions, array methods, classes, and more to create code that does more with less while yielding fewer bugs.
It's time to write JavaScript code that's clean and exprssive. Modern JavaScript is simpler and more predictable and readable than ever. Discover how to write better code with clear examples using principles that show how updated syntax can make code better with fewer bugs.
Starting from the ground up, learn new syntax (or how to reuse older syntax) to transform code from clunky bug-susceptible scripts to clear and elegant programs that are easy to read and easy to extend.
Create a foundation for readable code with simple variable declarations that reduce side effects and subtle bugs. Select collections with clear goals instead of defaulting to objects or arrays. See how to simplify iterations from complex loops to single line array methods. Master techniques for writing flexible and solid code ranging from high-order functions, to reusableclasses, to patterns for architecting large applications creating applications that will last while through rounds of refactoring and changing requirements.
The best part is there's no need to read this book straight through. Jump around and incorporate new functionality at will. Most importantly, understand not just what the new syntax is, but when and how to use it. Start writing better code from the first page.
What You Need:
For the best experience, have the latest version of Node installed (at least version 7). You can test most examples in the console of Chrome or other modern web browser. If you'd like to run the tests, you'll also need to install the latest version of Node Package Manager (npm).
Publisher resources
Table of contents
- Introduction
- 1. Signal Intention with Variable Assignment
- 2. Manage Data Collections with Arrays
-
3.
Maximize Code Clarity with Special Collections
- Tip 10. Use Objects for Static Key-Value Lookups
- Tip 11. Create Objects Without Mutations Using Object.assign()
- Tip 12. Update Information with Object Spread
- Tip 13. Update Key-Value Data Clearly with Maps
- Tip 14. Iterate Over Key-Value Data with Map and the Spread Operator
- Tip 15. Create Maps Without Side Effects
- Tip 16. Keep Unique Values with Set
- 4. Write Clear Conditionals
-
5. Simplify Loops
- Tip 20. Simplify Looping with Arrow Functions
- Tip 21. Write Shorter Loops with Array Methods
- Tip 22. Create Arrays of a Similar Size with map()
- Tip 23. Pull Out Subsets of Data with filter() and find()
- Tip 24. Apply Consistent Actions with forEach()
- Tip 25. Combine Methods with Chaining
- Tip 26. Transform Array Data with reduce()
- Tip 27. Reduce Loop Clutter with for...in and for...each
- 6. Clean Up Parameters and Return Statements
- 7. Build Flexible Functions
- 8. Keep Interfaces Clear with Classes
- 9. Access External Data
- 10. Gather Related Files with Component Architecture
- Bibliography
Product information
- Title: Simplifying JavaScript
- Author(s):
- Release date: April 2018
- Publisher(s): Pragmatic Bookshelf
- ISBN: 9781680502886
You might also like
book
Rediscovering JavaScript
JavaScript is no longer to be feared or loathed - the world's most popular and ubiquitous …
book
Refactoring JavaScript
How often do you hear people say things like this? "Our JavaScript is a mess, but …
book
Advanced JavaScript
Gain a deeper understanding of JavaScript and apply it to build small applications in backend, frontend, …
book
Clean Code in JavaScript
Get the most out of JavaScript for building web applications through a series of patterns, techniques, …