Javascript Passing Array To Function In Python To Reverse