Skip to content

Instantly share code, notes, and snippets.

@codenart
codenart / scope.js
Last active June 9, 2018 07:40
Using for codenart.github.io
var box = 'outer';
function just() {
var box = 'inner';
console.log(box);
}
just();
// result: 'inner'
@codenart
codenart / action.js
Last active June 9, 2018 11:43
Using for codenart.github.io
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');
@codenart
codenart / action.js
Last active June 16, 2018 12:17
Using for tutorials on codenart.github.io
var whisper = function() {
console.log('As the bee whispers among the leaves');
console.log('so the whispering of meditation is action.');
return 'nothing';
};
whisper();
@codenart
codenart / whisper.js
Last active June 9, 2018 07:40
Using for tutorials on codenart.github.io
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();
@codenart
codenart / return.js
Last active June 8, 2018 11:08
Using for tutorials on codenart.github.io
function sum(x, y) {
var result = x + y;
return result;
}
var nine = sum(3, 6);
console.log(nine);
// result: 9
@codenart
codenart / actions.js
Last active June 8, 2018 10:56
Using for tutorials on codenart.github.io
var content = getArticleContent();
var excerpt = makeExcerpt(content);
putExcerptBackToWebpage(excerpt);
@codenart
codenart / drink.js
Created June 8, 2018 09:19
Using for tutorials on codenart.github.io
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');
@codenart
codenart / drink.js
Created June 8, 2018 08:41
Using for tutorials on codenart.github.io
function drink(liquid) {
console.log('Take a cup of ' + liquid + '.');
console.log('Bow down with grace.');
console.log('Just drink.');
}
drink('mineral');
drink('lemonade');
@codenart
codenart / drink.js
Created June 8, 2018 08:07
Using for tutorials on codenart.github.io
function drink() {
console.log('Take a cup of tea.');
console.log('Bow down with grace.');
console.log('Just drink.');
}
drink('mineral');
drink('lemonade');
@codenart
codenart / drink.js
Last active June 8, 2018 06:13
Using for tutorials on codenart.github.io
function drink() {
console.log('Take a cup of tea.');
console.log('Bow down with grace.');
console.log('Just drink.');
}
// invoking the action
drink();