Train Now

Start training on this collection. Each time you skip or complete a kata you will be taken to the next kata in the series. Once you cycle through the items in the collection you will revert back to your normal training routine.

Description

Common gotchas in Javascript

In this collection we are dealing with the problems of null, falsy, undefined, and 0.

You might be hitting errors like:
TypeError: Cannot read property 'length' of undefined
Uncaught TypeError: undefined is not a function
TypeError: reduce of empty array with no initial value

And you will be thinking about questions like:

  • How do I check length safely?
  • How do I safely use reduce after a method like filter that has returned an empty array?
  • How do I say 'or this', if the first doesn't exist?
  • How do I set a default or fallback value?
  • How is null safety handled in JavaScript?

Some tools you will need:

And some tools to know about, but might not be available on this platform:

Ad
Fundamentals
Debugging
Functional Programming
Data Structures
Arrays
Fundamentals
Algorithms
Lists
Logic
Filtering
Fundamentals
Strings
Fundamentals
311,130JbPasquier
Arrays
Fundamentals