Javascript [Electronic resources] : The Definitive Guide (4th Edition) نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Javascript [Electronic resources] : The Definitive Guide (4th Edition) - نسخه متنی

David Flanagan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



Chapter 7. Functions


Functions
are an important and complex part of the JavaScript language. This
chapter examines functions from several points of view. First, we
discuss functions from the syntactic standpoint, explaining how they
are defined and invoked. Second, we cover functions as a data type,
with examples of the useful programming techniques that are made
possible by treating functions as data. Finally, we consider the
topic of variable scope within the body of a function and examine
some of the useful function-related properties that are available to
an executing function. This includes a discussion of how to write
JavaScript functions that accept an arbitrary number of arguments.

This chapter focuses on defining and invoking user-defined JavaScript
functions. It is also important to remember that JavaScript supports
quite a few
built-in
functions, such as eval( ), parseInt(
), and the sort( ) method of the Array
class. Client-side JavaScript defines others, such as
document.write( ) and alert( ).
Built-in functions in JavaScript can be used in exactly the same ways
as user-defined functions. You can find more information about the
built-in functions mentioned here in the core and client-side
reference sections of this book.

Functions and objects are intertwined in JavaScript. For this reason,
I'll defer discussion of some features of functions until Chapter 8.


/ 844