Python built-in functions implemented in javascript