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 box = 'outer'; | |
| function just() { | |
| var box = 'inner'; | |
| console.log(box); | |
| } | |
| just(); | |
| // result: 'inner' |
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 drink(container, liquid) { | |
| console.log('Take a ' + container + ' of ' + liquid + '.'); | |
| console.log('Bow down with grace.'); | |
| console.log('Just drink.'); | |
| } | |
| function whisper(just) { | |
| console.log('As the bee whispers among the leaves'); | |
| console.log('so the whispering of meditation is action.'); | |
| just('cup', 'tea'); |
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 whisper = function() { | |
| console.log('As the bee whispers among the leaves'); | |
| console.log('so the whispering of meditation is action.'); | |
| return 'nothing'; | |
| }; | |
| whisper(); |
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 whisper() { | |
| console.log('As the bee whispers among the leaves'); | |
| console.log('so the whispering of meditation is action.'); | |
| return 'nothing'; | |
| console.log('This statement will be ignored.'); | |
| } | |
| whisper(); |
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 sum(x, y) { | |
| var result = x + y; | |
| return result; | |
| } | |
| var nine = sum(3, 6); | |
| console.log(nine); | |
| // result: 9 |
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 content = getArticleContent(); | |
| var excerpt = makeExcerpt(content); | |
| putExcerptBackToWebpage(excerpt); |
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 drink(container, liquid) { | |
| console.log('Take a ' + container + ' of ' + liquid + '.'); | |
| console.log('Bow down with grace.'); | |
| console.log('Just drink.'); | |
| } | |
| drink('cup', 'lemonade'); | |
| drink('bottle', 'mineral'); |
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 drink(liquid) { | |
| console.log('Take a cup of ' + liquid + '.'); | |
| console.log('Bow down with grace.'); | |
| console.log('Just drink.'); | |
| } | |
| drink('mineral'); | |
| drink('lemonade'); |
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 drink() { | |
| console.log('Take a cup of tea.'); | |
| console.log('Bow down with grace.'); | |
| console.log('Just drink.'); | |
| } | |
| drink('mineral'); | |
| drink('lemonade'); |
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 drink() { | |
| console.log('Take a cup of tea.'); | |
| console.log('Bow down with grace.'); | |
| console.log('Just drink.'); | |
| } | |
| // invoking the action | |
| drink(); |