javascript: Fix enumerate example