Maurice Butler (@butlermaurice)
Kory Nunn (@korynunn)
Don't use jQuery
Don't use express
Maurice Butler (@butlermaurice)
Kory Nunn (@korynunn)
for(var key in obj){
if(!obj.hasOwnProperty(key)){
continue;
}
// Do something.
}
var keys = Object.keys(obj);
for(var i = 0; i < keys.length; i++){
// Object.keys only returns own properties.
// Do something.
}
function isPrime(n) {
if (isNaN(n) || !isFinite(n) || n % 1 || n < 2) {
return false;
}
var m = Math.sqrt(n);
for (var i = 2; i <= m; i++) {
if (n % i === 0) {
return false;
}
}
return true;
}
var cache = {};
function isPrimeMemoised(n) {
if(n in cache){
return cache[n];
}
if (isNaN(n) || !isFinite(n) || n % 1 || n < 2) {
return cache[n] = false;
}
var m = Math.sqrt(n);
for (var i = 2; i <= m; i++) {
if (n % i === 0) {
return cache[n] = false;
}
}
return cache[n] = true;
}
function onMouseMove(event){
$('.someUniqueElement').left(event.pageY);
$('.someUniqueElement').top(event.pageY);
}
var someUniqueElement = $('.someUniqueElement');
function onMouseMove(event){
someUniqueElement.left(event.pageY);
someUniqueElement.top(event.pageY);
}
Brendan D. Gregg (@brendangregg) is a legend at this stuff
All you need to know about Flame Graphs is here brendangregg.com/flamegraphs
Maurice Butler (@butlermaurice)
Kory Nunn (@korynunn)