Содержание
- 2. Functions
- 3. A JavaScript function is a block of code designed to perform a particular task. A JavaScript
- 4. A JavaScript function is a block of code designed to perform a particular task. A JavaScript
- 5. Functions
- 6. Invocation: When an event occurs (when a user clicks a button) When it is invoked (called)
- 7. Invocation: When an event occurs (when a user clicks a button) When it is invoked (called)
- 8. Function Purpose Reuse Information hiding Purpose Composition
- 9. Function Purpose
- 10. Function Definition JavaScript functions are defined with the function keyword. You can use a function declaration
- 11. Function Definition JavaScript functions are defined with the function keyword. You can use a function declaration
- 12. Function Definition JavaScript functions are defined with the function keyword. You can use a function declaration
- 13. Function Definition The Function() Constructor: var myFunction = new Function("a", "b", "return a * b"); //
- 14. Function Definition The Function() Constructor: Anti-pattern
- 15. Function Definition Try: // v 1.1 function foo (a, b) { return a * b; }
- 16. Function Definition Try: // v 1.1 function foo (a, b) { return a * b }
- 17. Function Definition Try: // v 1.1 function foo (a, b) { return a * b }
- 18. Function Definition Try: // v 1.1 function foo (a, b) { return a * b }
- 19. Function Definition Try: // v 1.1 function foo (a, b) { return a * b }
- 20. Hoisting Hoisting is JavaScript's default behavior of moving declarations to the top of the current scope.
- 21. Hoisting Hoisting is JavaScript's default behavior of moving declarations to the top of the current scope.
- 22. Hoisting Hoisting is JavaScript's default behavior of moving declarations to the top of the current scope.
- 23. Hoisting
- 24. Self-Invoking Functions You have to add parentheses around the function to indicate that it is a
- 25. Self-Invoking Functions You have to add parentheses around the function to indicate that it is a
- 26. Function Parameters Function parameters are the names listed in the function definition. Function arguments are the
- 27. Function Parameters Function parameters are the names listed in the function definition. Function arguments are the
- 28. Function Parameters If a function is called with missing arguments (less than declared), the missing values
- 29. Function Parameters If a function is called with missing arguments (less than declared), the missing values
- 30. Arguments Object The argument object contains an array of the arguments used when the function was
- 31. Arguments Object The argument object contains an array of the arguments used when the function was
- 32. Function Invocation Invoking a function suspends the execution of the current function, passing control and parameters
- 33. Function Invocation Invoking a function suspends the execution of the current function, passing control and parameters
- 34. Function Invocation Invoking a function suspends the execution of the current function, passing control and parameters
- 35. Invoking a Function as a Method When a function is stored as a property of an
- 36. Invoking a Function as a Function The function does not belong to any object. In a
- 37. Invoking a Function as a Function The function does not belong to any object. In a
- 38. Invoking a Function as a Function !!! A method cannot employ an inner function to help
- 39. Invoking a Function as a Function Fortunately, there is an easy workaround. var add = function
- 40. Invoking a Function with a Function Constructor If a function invocation is preceded with the new
- 41. Invoking a Function with a Function Constructor If a function invocation is preceded with the new
- 42. Invoking a Function with a Function Method In JavaScript, functions are objects. JavaScript functions have properties
- 43. Invoking a Function with a Function Method // Create a constructor function called Quo.It makes an
- 44. Invoking a Function with a Function Method // Create a constructor function called Quo.It makes an
- 46. Скачать презентацию