Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function example() {
- console.log("invoking function b declared inside the if statement will return an error since the if statement condition is not yet evaluated "+b());
- function a() {
- return "you invoked function a";
- }
- if (true) {
- console.log("inside the if block"+a());
- console.log("inside the if block above function b declaration"+b());
- function b() {
- return "you invoked function b";
- }
- }
- console.log("you invoked function b below the if block scope(after the if statement condition is met) "+b());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement