This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var countdown = function count(num) { | |
| console.log(num); | |
| if (num <= 0) { count(num - 1); } | |
| } | |
| countdown(2); | |
| count(2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (console.log) { | |
| var greet = function(name) { console.log(name); } | |
| } else { | |
| var greet = function(name) { alert(name); } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (console.log) { | |
| function greet(name) { console.log(name); } | |
| } else { | |
| function greet(name) { alert(name); } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function example4() { | |
| var f = function() { console.log("First f"); } | |
| return f(); | |
| var f = function() { console.log("Second f"); } | |
| } | |
| example4(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function example3() { | |
| function f() { console.log("First f"); } | |
| return f(); | |
| function f() { console.log("Second f"); } | |
| } | |
| example3(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function example2() { | |
| f(); | |
| var f = function() { console.log("f"); } | |
| } | |
| example2(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function example1() { | |
| f(); | |
| function f() { console.log("f"); } | |
| } | |
| example1(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Function declaration | |
| function hello() { console.log("Hello"); } | |
| // Function expression | |
| var hello = function() { console.log("Hello"); } | |
| // Function expressions with binding identifier | |
| var hello = function hello() { console.log("Hello"); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pop:sections> | |
| <li class="<pop:first>first</pop:first> <pop:last>last</pop:last>"><a href="<pop:permalink/>"><pop:title/></a></li> | |
| </pop:sections> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.get = { | |
| "Product1": function(params) { | |
| response.send("Redirecting", {Location: "/products/product1"}, 301); | |
| }, | |
| "Product2": function(params) { | |
| response.send("Redirecting", {Location: "/products/product2"}, 301); | |
| } | |
| } |