javascript questions

2010-02-19 4:43 pm
1.In an error-free JavaScript program, can you have a function definition without a call to it?
2.Syntactically speaking, i.e., looking at JavaScript code, how can you distinguish a function definition from a function call?
3. a storyteller (madlips) page that allows the user to fill in the blanks. . Describe how;filling in the blanks is one way to think of what happens when a function with parameters is called. In the context of calling functions, what are the blanks, and what is used to fill them?

回答 (1)

2010-02-19 5:10 pm
✔ 最佳答案
1. Function definitions can be done without actually using them (i.e. do function calls). While it is true for Javascript, it is also true for many other languages.

2. One can tell a function definition from a function call by the use of the function keyword.

3. In the context of function calls, the blanks are the parameter variables which are required upon making the calls. Global variables may also serve as the blanks, but in general speaking, use of global variables should be avoided wherever possible to make the function more readable and less error prone. When making actual function calls, actual values, or variables which contain the actual values, are passed to the function as parameters.
參考: me


收錄日期: 2021-05-01 01:03:43
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20100219000051KK00292

檢視 Wayback Machine 備份