Skip to Content
React 16 Tooling
book

React 16 Tooling

by Adam Boduch, Christopher Pitt
April 2018
Intermediate to advanced content levelIntermediate to advanced
298 pages
6h 34m
English
Packt Publishing
Content preview from React 16 Tooling

Removing runtime checks

The solution to handling data with unknown types in dynamic languages such as JavaScript is to check values at runtime. Depending on the type of value, you might have to perform some alternate action to get the value that your code is expecting. For example, a common idiom in JavaScript is to make sure that a value is neither undefined or null. If it is, then we either throw an error or provide a default value.

When you perform runtime checks, it changes the way you think about your code. Once you start performing these checks, they inevitably evolve into more elaborate checks and more of them. This frame of mind really amounts to not trusting yourself or others to call code with the correct data. You think since it's ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro React 16

Pro React 16

Adam Freeman

Publisher Resources

ISBN: 9781788835015Supplemental Content