adds javascript version of functional primitives