Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. fn(); //--> Error, fn is called before the function is assigned!
  2. var fn = function () { alert("abc"); } 
  3.  
  4.  
  5. fn2(); //--> Works as expected: the fn2 declaration is hoisted above the call
  6. function fn2() { alert("test!"); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement