Summary

You have now completed the introduction to the fundamental concepts related to functions in JavaScript. You've been laying the groundwork that will allow you to quickly grasp the concepts of object-oriented JavaScript and the patterns used in modern JavaScript programming. So far, we've been avoiding the OO features, but as you have reached this point in the book, it's only going to get more interesting from here on in. Let's take a moment and review the topics discussed in this chapter:

  • The basics of how to define and invoke (call) a function using either a function declaration syntax or a function expression
  • Function parameters and their flexibility
  • Built-in functions—parseInt(), parseFloat(), isNaN(), isFinite(), and eval()—and the four functions to encode/decode a URL
  • The scope of variables in JavaScript—no curly braces scope, variables have only function scope and the scope chain
  • Functions as data—a function is like any other piece of data that you assign to a variable and a lot of interesting applications follow from this, such as:
    • Private functions and private variables
    • Anonymous functions
    • Callbacks
    • Immediate functions
    • Functions overwriting themselves
  • Closures
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.199.243