javascript: foreach