Javascript Map Over Empty Array Check