can use ruby enumerator methods in javascript