Adding Element In Array Js Functions Types