Arrays

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wangers16
    New Member
    • Jul 2007
    • 57

    Arrays

    Hi,

    Is there a way to write out an array, only instead of it coming out in one long string with just commas seperating each item have them written in a vertical list and with any other kind of formatting?
  • mrhoo
    Contributor
    • Jun 2006
    • 428

    #2
    Use the join method, with the delimeter specified as the argument:

    var A=['Tom','Dick',Ha rry'];
    alert(A.join('\ n'));

    Comment

    • wangers16
      New Member
      • Jul 2007
      • 57

      #3
      thanks and is there any way to add hyperlinks to each one individually?

      Comment

      • rnd me
        Recognized Expert Contributor
        • Jun 2007
        • 427

        #4
        you can space them out however you want, it doesnt matter.

        [ 1,
        2,
        3 ] == [1,2,3] === [1,



        2 ,



        3


        ]

        Comment

        • wangers16
          New Member
          • Jul 2007
          • 57

          #5
          yes but is there any way to add hyperlinks to each item in the array?

          Comment

          Working...