Skip to content

Instantly share code, notes, and snippets.

View peterschussheim's full-sized avatar

Peter Schussheim peterschussheim

View GitHub Profile
@peterschussheim
peterschussheim / good-parts-of-js-w-doug-crockford.markdown
Last active October 1, 2016 18:56
Good Parts of JS w Doug Crockford

Accessing object props

//Count Vowels
function countVowels(string) {
var vowels,
result,
totalSum,
a,
aSum,
e,
eSum,

twittler

@peterschussheim
peterschussheim / addTwoDigits.js
Last active October 1, 2016 15:58
Separate an integer into an array of digits. Test
function addTwoDigits(n) {
var arr = n.toString(10).split("").map(function(t) {
return parseInt(t);
});
var sum = arr.reduce(function(a, b) {
return a + b;
});
return sum;

underbar

Widget Menagerie

stringify