Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- var some_func = function(arg1, arg2) {
- //some code here
- }
- }
- var variable = some_func(a1);
- function foo(bar) {
- console.log(bar);
- console.log(baz);
- }
- > foo()
- < undefined
- < ReferenceError: Can't find variable: baz
- i. Let n be the current value of n plus 1.
- ii. If n is greater than argCount, let v be undefined
- otherwise let v be the value of the nβth element of args.
- var some_func = function(arg1, arg2) {
- alert(arg1); alert(arg2);
- }
- some_func('a'); // alerts a and undefined
- some_func('a','b'); // alerts a and b
- var x; // defined but has undefined value will not throw error Result in undefined
- y; // not defined and throws a value. Result in ReferenceError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement