Chapter 23Evaluation and Compilation

JavaScript is replete with functions that allow you to evaluate various items. The basic idea is that these built-in functions will allow you to extract data about something, such as a string. This is a somewhat advanced topic and many JavaScript developers work for years without ever having to use these functions. So if you have trouble with the functions in this chapter, don’t worry—just do the best you can with them. In time as you encounter places to use them, their use will become more clear.

Evaluating a String

The eval function executes the JavaScript contained within the brackets. In some cases, this may return a value that can be assigned to a variable. It is used to evaluate whatever is passed to ...

Get Advanced Javascript, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.