[javascript] Checking something isEmpty in Javascript?