Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function example() {
  2. console.log("invoking function b declared inside the if statement will return an error since the if statement condition is not yet evaluated "+b());
  3. function a() {
  4. return "you invoked function a";
  5. }
  6. if (true) {
  7. console.log("inside the if block"+a());
  8. console.log("inside the if block above function b declaration"+b());
  9. function b() {
  10. return "you invoked function b";
  11. }
  12. }
  13. console.log("you invoked function b below the if block scope(after the if statement condition is met) "+b());
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement