Inversion of Control is a simple principle that can drastically improve your reusable code. In this lesson we'll go over the concept and you'll get an idea of how you can apply it for your own abstractions.
This is based on my blog post: Inversion of Control
Thanks for this. I will definitely be using inversion more in the future. Note to others: at the end of the video you probably want legCount
set in the filterByLegCount
function:
function filterByLegCount(array, legCount) {
return filter(array, animal => animal.legs === legCount);
}
Hello Kent,
Correct me if I'm wrong. To check undefined and null like this (element !== null && element !== undefined). Hope the following will work (element != null) this checks both undefined and null.