Python Pattern Match Array Function In Js W3