Skip to content
JS

Safer JavaScript with the Maybe Type

Course on egghead by Andy Van Slaars

View on egghead (opens in a new tab)
50 min
LengthVideo runtime
Subscription
Price modelegghead plan
12
Lessons
3.8
Rating out of 56 ratings on egghead
May 2018
Published7 May 2018

About this course

Description from egghead

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.

What it covers

12 lessons
  1. 1Course Introduction: Safer JavaScript with the Maybe type
  2. 2Understand the Maybe Data Type
  3. 3Create a Maybe with a `safe` Utility Function
  4. 4Unwrap Values from a Maybe
  5. 5Safely Access Object Properties with `prop`
  6. 6Safely Access Nested Object Properties with `propPath`
  7. 7Flatten Nested Maybes with `chain`
  8. 8Recover from a Nothing with the `alt` method
  9. 9Recover from a Nothing with the `coalesce` Method
  10. 10Compose Functions for Reusability with the Maybe Type
  11. 11Apply a function in a Maybe context to Maybe inputs
  12. 12Make your own functions safer by lifting them into a Maybe context

Similar JavaScript courses

  1. Learn ES6 (ECMAScript 2015)

    egghead · John Lindquist · 15 lessons · 4.2 from 100 ratings · Apr 2016

    52 minSubscription
    egghead154.2 (100)Apr 2016
  2. Reduce Data with Javascript Array reduce

    egghead · mykola bilokonsky · 8 lessons · 4.9 from 81 ratings · Jan 2016

    48 minSubscription
    egghead84.9 (81)Jan 2016
  3. Build a Video Chat App with Twilio and Gatsby

    egghead · Jason Lengstorf · 10 lessons · 4.6 from 2 ratings · Dec 2019

    47 minSubscription
    egghead104.6 (2)Dec 2019
  4. Beginner40 minSubscription
    Educative10Nov 2024
  5. Beginner1 h
    CourseraOct 2020
  6. How to Deploy a Website

    Codecademy · 3 lessons · Apr 2018

    Beginner1 h
    Codecademy3Apr 2018
  7. Beginner1 h
    CourseraMay 2024
  8. Beginner1 h
    Codecademy2Nov 2018

A hyphen means the provider's catalogue does not state the value.

Same topic, nearest in length, up to three from any one provider.

Data read from the egghead catalogue on 28 Nov 2026. How the data is collected.

    Compare