Useful linq function implementations for javascript