Anonymous
Anonymous asked in 電腦及互聯網程式編寫及設計 · 1 decade ago

javascript questions

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 Answer

Rating
  • 1 decade ago
    Favorite Answer

    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.

    Source(s): me
Still have questions? Get your answers by asking now.