Skip to content

Instantly share code, notes, and snippets.

Mattias Petter Johansson mpj

Block or report user

Report or block mpj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:45927f139d544123093d
function reduce(arr, fn, initial) {
//there's no more elements in the array, we return I get that
if (arr.length === 0) {
return initial;
} // base case, does not recurse
// we are calling the actual function here with the first element in the array
//I don't get what initial is ??
@mpj
mpj / gist:3190504
Created Jul 27, 2012 — forked from idan/gist:3135754
A Sample Post
View gist:3190504

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

You can’t perform that action at this time.