Add js implementation for 1.2