Safer JavaScript with the Maybe Type
Offered By: egghead.io
Course Description
Overview
JavaScript’s dynamic typing makes it incredibly flexible. That flexibility can lead to trouble though. When values have the potential to change types or to end up as null or undefined, that can lead to runtime errors in our code or bizarre bugs that take forever to track down because of type coercion. To battle this, we end up with code that is littered will conditionals for null or undefined values and type checks, making the core logic harder to read and refactor later.
The Maybe encapsulates the type checking and guards against missing values for us. With Maybe in our toolbelt, we can keep our functions free of all the guardrails, outsource that work to the Maybe and keep our business logic free of all the clutter.
The Maybe encapsulates the type checking and guards against missing values for us. With Maybe in our toolbelt, we can keep our functions free of all the guardrails, outsource that work to the Maybe and keep our business logic free of all the clutter.
Syllabus
- Course Introduction: Safer JavaScript with the Maybe type
- Understand the Maybe Data Type
- Create a Maybe with a `safe` Utility Function
- Unwrap Values from a Maybe
- Safely Access Object Properties with `prop`
- Safely Access Nested Object Properties with `propPath`
- Flatten Nested Maybes with `chain`
- Recover from a Nothing with the `alt` method
- Recover from a Nothing with the `coalesce` Method
- Compose Functions for Reusability with the Maybe Type
- Apply a function in a Maybe context to Maybe inputs
- Make your own functions safer by lifting them into a Maybe context
Taught by
Andy Van Slaars
Related Courses
Android Fundamentals: View BindingPluralsight Update to Modern C++
Udemy How to Avoid Safety Hazards When Using Closures in Scala
Strange Loop Conference via YouTube NULL Pointers in C Language - Tutorial 53
CodeWithHarry via YouTube MISRA C++202x - It Ain't Your Grandpa's MISRA Any More
NDC Conferences via YouTube