The JavaScript Way
The JavaScript Way
Master the language that powers the digital world
About the Book
From web sites and apps to servers, smartphones and connected objects, JavaScript is everywhere. It has evolved from a niche scripting tool crafted in a few days into a modern, multi-purpose language sitting on top of a rich ecosystem and a vibrant developer community. Some even consider JavaScript to be the most important technology in software development nowadays.
However, learning JavaScript properly is not that easy. Many resources are outdated and teach obsolete practices. Many others cover advanced topics that are of little interest to beginners and "switchers" coming from other languages and platforms.
Beginner-friendly yet comprehensive, standards-aligned, hands-on and easy to follow, this book will be a useful companion for anyone wishing to explore the many facets of JavaScript.
About the Contributors
Teacher @ OpenClassrooms
Initial English translation and many good ideas.
Editor @ OpenClassrooms
Initial proofreading and many good ideas.
Reader Testimonials
![Dmitri Grabov](https://s3.amazonaws.com/testimonials.leanpub.com/avatars/634/small/main-thumb-8073847-200-tdaghngwbtagqnyswjapuzdgedkgtspq.jpeg?1523646087)
Dmitri Grabov
Founder and JavaScript instructor at Constructor Labs
The best entry level JS book out there
Ahmed Alharbi
Multidisciplinary freelance developer
There's literally no other book that helped me like yours did in my school, work and ultimately in my life and career, I’m literally writing apps now. Your way of saying things is just on point.
![Sasha Argunov](https://s3.amazonaws.com/testimonials.leanpub.com/avatars/637/small/52131081.jpg?1523652631)
Sasha Argunov
If you are searching for a solid understanding of the language with a lot of examples and exercises, that's the book for you. I was actually surprised by how good the book was. It's so far my favourite.
Table of Contents
-
Introduction
-
About this book
- Who this book is for
- Book structure
-
Welcome to programming
- What’s in a program?
- How do you create programs?
- Learn to code
- TL;DR
-
Introducing JavaScript
- A brief history of JavaScript
- JavaScript: an essential language
- Version used in this book
- TL;DR
-
Environment setup
- Prerequisite: a modern browser
- Solution 1: coding online
- Solution 2: using a local development environment
- TL;DR
-
About this book
-
Learn to code programs
-
3, 2, 1… Code
- Your first program
- Values and types
- Program structure
- TL;DR
- Coding time!
-
Play with variables
- Variables
- Expressions
- Type conversions
- User interactions
- Variable naming
- TL;DR
- Coding time!
-
Add conditions
- What’s a condition?
- Alternative conditions
- Add additional logic
- Multiple choices
- TL;DR
- Coding time!
-
Repeat statements
- Introduction
-
The
while
loop -
The
for
loop - Common mistakes
- Which loop structure should I use?
- TL;DR
- Coding time!
-
Write functions
- Introduction: the role of functions
- Discovering functions
- Function contents
- Anonymous functions
- Guidelines for programming with functions
- TL;DR
- Coding time!
-
Create your first objects
- Introduction
- JavaScript and objects
- Programming with objects
- JavaScript predefined objects
- TL;DR
- Coding time!
-
Store data in arrays
- Introduction to arrays
- Manipulating arrays in JavaScript
- Iterating over an array
- Updating an array’s content
- TL;DR
- Coding time!
-
Work with strings
- String recap
- Obtaining string length
- Converting string case
- Comparing two strings
- Strings as sets of characters
- Turning a string into an array
- Searching inside a string
- Breaking a string into parts
- TL;DR
- Coding time!
-
Understand object-oriented programming
- Context: a multiplayer RPG
- JavaScript classes
- Under the hood: objects and prototypes
- Object-oriented programming
- TL;DR
- Coding time!
-
Discover functional programming
- Context: a movie list
- Program state
- Pure functions
- Array operations
- Higher-order functions
- JavaScript: a multi-paradigm language
- TL;DR
- Coding time!
-
Project: a social news program
- Objective
- Functional requirements
- Technical requirements
- Expected result
-
3, 2, 1… Code
-
Create interactive web pages
-
What’s a web page?
- Internet and the Web
- The languages of the Web
- Developing web pages
- TL;DR
- Coding time!
-
Discover the DOM
- Introduction to the DOM
- Web page structure
- Get started with the DOM in JavaScript
- TL;DR
- Coding time!
-
Traverse the DOM
- Sample web page
- Selecting elements
- Obtaining information about elements
- TL;DR
- Coding time!
-
Modify page structure
- Modify an existing element
- Adding a new element
- Variations on adding elements
- Replacing or removing nodes
- Styling elements
- DOM manipulations and performance
- TL;DR
- Coding time!
-
React to events
- Introduction to events
- The event family
- Reacting to common events
- Go farther with events
- TL;DR
- Coding time!
-
Manipulate forms
- JavaScript and forms
- Form fields
- Forms as DOM elements
- Form validation
- TL;DR
- Coding time!
-
Animate elements
- Repeat an action at regular intervals
- Trigger an action after a delay
- Animate page elements
- Choosing the right animation technique
- TL;DR
- Coding time!
-
Project: a social news web page
- Objective
- Functional requirements
- Technical requirements
- Starter code
- Expected result
-
What’s a web page?
-
Build web applications
-
Web development 101
- How the Web works
- HTTP, the web protocol
- From web sites to web apps
- JSON, a data format for the web
- TL;DR
-
Query a web server
- Creating asynchronous HTTP requests in JavaScript
- Handling JSON data
- TL;DR
- Coding time!
-
Use web APIs
- Introducing web APIs
- Consuming a web API
- Web APIs and authentication
- TL;DR
- Coding time!
-
Send data to a web server
- Sending data: the basics
- Sending form data
- Sending JSON data
- TL;DR
- Coding time!
-
Discover Node.js
- Introducing Node.js
- Node.js modules
- Node.js packages
- Package management with npm or yarn
- TL;DR
- Coding time!
-
Create a web server
- Using a framework
- Responding to requests
- Creating an API
- Exposing data
- Accepting data
- Publishing web pages
- TL;DR
- Coding time!
-
Project: a social news web app
- Objective
- Functional requirements
- Technical requirements
- Expected result
-
Web development 101
-
Conclusion
-
Summary and perspectives
- Key takeaways
- The road ahead
-
Summary and perspectives
-
Appendices
-
Style guide
- Naming
- Code formatting
- Code quality
- Acknowledgments
-
Style guide
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them