Check If Value Is Empty Array Javascript Function