You are previewing Secrets of the JavaScript Ninja.

Secrets of the JavaScript Ninja

Cover of Secrets of the JavaScript Ninja by John Resig and Bear Bibeault Published by Manning Publications
O'Reilly logo

Chapter 9. Ninja alchemy: runtime code evaluation

This chapter covers

  • How runtime code evaluation works
  • Different techniques for evaluating code
  • Using evaluation in applications
  • Decompiling functions
  • Namespacing
  • Compressing and obfuscating

One of the many powerful abilities that distinguish JavaScript from many other languages is its ability to dynamically interpret and execute pieces of code at runtime. Code evaluation is simultaneously a powerful, as well as a frequently misused, feature of JavaScript. Understanding the situations in which it can and should be used, along with the best techniques for using it, can give us a marked advantage when creating advanced application code.

In this chapter, we’ll explore the various ways of ...

The best content for your career. Discover unlimited learning on demand for around $1/day.