I hereby claim:
- I am webdesserts on github.
- I am webdesserts (https://keybase.io/webdesserts) on keybase.
- I have a public key whose fingerprint is EFEF AB55 BA03 4063 BB37 6F25 BD9D 259B A9DF DEE0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
.code-block { | |
/* My special code block. Covers 90% of all use cases. */ | |
} |
{ | |
"name": "web-app", | |
"scripts": { | |
"build": "gulp build", | |
"start": "gulp serve", | |
"test": "gulp test" | |
}, | |
"devDependencies": { | |
"gulp": "~3" | |
} |
// create a "Class-like" object | |
var Point = {} | |
// create an object like this one, but with a clean state | |
Point.create = function create () { | |
var new_shape = Object.create(this) | |
new_shape.init.apply(new_shape, arguments) | |
return new_shape | |
} |
/**========================================* | |
* Alchemist.js - Exploring a possible API * | |
*=========================================*/ | |
/**=============* | |
* Conversions * | |
*=============**/ |
var desserts = ['gelato', 'tiramisu', 'double chocolate volcano cake'] | |
// indexOf() is a nifty little Array method that returns the index of the element passed | |
desserts.indexOf('gelato') //=> 0 | |
// One oditty of it is that it returns -1 if there is no match. | |
desserts.indexOf('meatloaf') //=> -1 | |
// So the question arrises, "why -1"? |