Skip to Content
Mastering JavaScript Functional Programming
book

Mastering JavaScript Functional Programming

by Federico Kereki
November 2017
Intermediate to advanced
386 pages
9h 22m
English
Packt Publishing
Content preview from Mastering JavaScript Functional Programming

Answers to Questions

Here are solutions (partial, or worked out in full) to the questions posed along the text. In many cases, there are extra questions for you to do further work.

1.1. Classes as first class objects. If you remember that a class is basically a function that can be used with new, then it stands to reason that we should be able to pass classes as parameters to other functions. The makeSaluteClass() basically creates a class (that is, a special function) that uses a closure to remember the value of term. We'll be seeing more examples of these kind of things in the rest of the book.

1.2. Factorial errors. The key to avoiding repeated tests is to write a function that will:

  • First check the value of the argument to see it 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

Mastering JavaScript Functional Programming - Second Edition

Mastering JavaScript Functional Programming - Second Edition

Federico Kereki

Publisher Resources

ISBN: 9781787287440Supplemental Content