gen-pasta

A collection of general functions that I have found myself copy pastaing around.

#General Pasta

A collection of general functions that I have found myself copy pastaing around.

I am trying to separate the pasta into useful strands.

##log()

Takes any number of args and logs them if it can.

##slice(obj[, start, end])

Take an array like object and return a real array. Optional start/end.

##combine(obj1, obj2)

Add everything from obj2 into obj1 and return obj1.

##last(item)

Attempt to return the last element from item, whatever item might be.

##first(item)

Attempt to return the first element from item, whatever item might be.

##flatten(arr)

Steamrolls nested arrays into a string.