Skip to content

Instantly share code, notes, and snippets.

@coreyc
coreyc / getValuesFromObjectKeys.js
Created September 22, 2015 00:21
functional way to get values from object keys
var inputObject = { 0: 'a', 1: 'b', 2: 'c' };
var values = [];
Object.keys(inputObject).forEach(function(key) {
values.push(inputObject[key]);
return values;
});
console.log(values);
@coreyc
coreyc / instanceof-vs-typeof.js
Created September 22, 2015 00:15
check if string is typeof or instanceof
function isString(str) {
return typeof(str) === 'string' || str instanceof String;
}