Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. {
  2. var some_func = function(arg1, arg2) {
  3. //some code here
  4. }
  5. }
  6.  
  7. var variable = some_func(a1);
  8.  
  9. function foo(bar) {
  10. console.log(bar);
  11. console.log(baz);
  12. }
  13.  
  14. > foo()
  15. < undefined
  16. < ReferenceError: Can't find variable: baz
  17.  
  18. i. Let n be the current value of n plus 1.
  19.  
  20. ii. If n is greater than argCount, let v be undefined
  21. otherwise let v be the value of the n’th element of args.
  22.  
  23. var some_func = function(arg1, arg2) {
  24. alert(arg1); alert(arg2);
  25. }
  26.  
  27. some_func('a'); // alerts a and undefined
  28. some_func('a','b'); // alerts a and b
  29.  
  30. var x; // defined but has undefined value will not throw error Result in undefined
  31. y; // not defined and throws a value. Result in ReferenceError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement