Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8073651

Values of a map can be iterated normally, in section 2.8 of the nashorn guide

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • 8u31
    • docs
    • x86
    • windows_8

      A DESCRIPTION OF THE PROBLEM :
      This section says: "Unlike other collections, to iterate over keys and values in a map, you must use the keySet() and values() methods."

      However, to iterate over values in a map, you can also use the general syntax to iterate over a collection, i.e.:

      for each (var i in hm) print(i)

      instead of:

      for each (var i in hm.values()) print(i)



      URL OF FAULTY DOCUMENTATION :
      http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/api.html#sthref23

            rgallard Raymond Gallardo
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: