Javascript Get First Element Of Array If Not Empty