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

Currying with eval()

There's another interesting way of currying a function, by creating a new one by means of eval()... yes, that unsafe, dangerous, eval()! (Remember what we said earlier: this is for learning purposes, but you'll be better off by avoiding the potential security headaches that eval() can bring!) We will also be using the range() function that we wrote in the Working with ranges section of Chapter 5, Programming Declaratively - A Better Style.

Languages such as LISP have always had the possibility of generating and executing LISP code. JavaScript shares that functionality, but it's not often used -- mainly because of the dangers it may entail! However, in our case, since we want to generate new functions, it seems logical ...
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