Skip to content

Instantly share code, notes, and snippets.

View jherax's full-sized avatar
:atom:
Performance focused

David Rivera jherax

:atom:
Performance focused
View GitHub Profile
@jherax
jherax / sortBy-old.js
Last active November 8, 2018 04:01
Sorting Arrays
/*
* Important!
* This snippet is deprecated, a best implementation of sortBy can be found here:
* https://github.com/jherax/array-sort-by
*/
var sortBy = (function () {
var toString = Object.prototype.toString,
// default parser function
parse = function (x) { return x; },
@jherax
jherax / js-1-inheritance.js
Last active September 24, 2018 18:09
JavaScript OOP: Herencia y Prototipos
//definimos el constructor del objeto base y
//establecemos las propiedades por instancia
function Person (name, age) {
"use strict";
this.name = name || "unnamed";
this.age = +age || 0;
}
//definimos el prototipo del objeto base
//estableciendo las propiedades compartidas
@jherax
jherax / falsy-values.txt
Last active April 13, 2016 18:06
JavaScript coercion
VALOR COERCIÓN
------- ---------
false false
0 false
“” false
NaN false
null false
undefined false