Basic JavaScript tips

Check if a string exists javascript