Node Js Array Functions Python Code