What do you think?
Rate this book
270 pages, ebook
while (!end) {
/* do loop body stuff */
if (endReason) {
var end = true;
}
}
let end = false;
while (!end) {
/* do loop body stuff */
if (endReason) {
end = true
}
}
if (somethingHappened) {
/* unnecessary block scope introduced solely to enforce least-exposure */
{
let msg = somethingHappened.msg();
notifyOthers(msg)
}
recoverFromSomething();
}
function myFunc() {
/* function body */
}
//
invocationOfAFunctionConsumingFunction(function myConsumedFunction() {
/* my consumed function body */
});
const myFuncVar = function() {
}
[ 1, 2, 3, 4, 5].filter(function(v){ return v % 2 == 1;})
[ 1, 2, 3, 4, 5].filter(function keepOnlyOdds(v){
return v % 2 == 1;
})
const oddNumbers = [1, 2, 3, 4, 5].filter(function(v){ return v % 2 == 1;})
const oddNumbers = [1, 2, 3, 4, 5].filter((n) => n % 1 === 1)