a = [ "1", "2", "3" ] v/s a = new Array ( "1", "2", "3" )identical in all ways?

Discussion in 'Javascript' started by okey, Aug 25, 2009.

  1. okey

    okey Guest

    Do these result in identical objects?

    a = [ "1", "2", "3" ]
    a = new Array ( "1", "2", "3" )
    okey, Aug 25, 2009
    #1
    1. Advertising

  2. Re: a = [ "1", "2", "3" ] v/s a = new Array ( "1", "2", "3" )identical in all ways?

    On Aug 25, 1:30 pm, okey wrote:
    > Do these result in identical objects?
    >
    > a = [ "1", "2", "3" ]
    > a = new Array ( "1", "2", "3" )


    Yes, but:-

    a = [ 2 ];
    a = new Array( 2 );

    - do not.

    Richard.
    Richard Cornford, Aug 25, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adam Hartshorne
    Replies:
    7
    Views:
    434
    Ivan Vecerina
    Feb 21, 2005
  2. Raseliarison nirinA
    Replies:
    5
    Views:
    969
    Raseliarison nirinA
    Jul 21, 2003
  3. Raseliarison nirinA
    Replies:
    0
    Views:
    604
    Raseliarison nirinA
    Jul 21, 2003
  4. Klaus Neuner
    Replies:
    4
    Views:
    294
    Klaus Neuner
    Feb 10, 2004
  5. Mark Fayngersh

    All possible ways of iterating

    Mark Fayngersh, Sep 2, 2009, in forum: Ruby
    Replies:
    5
    Views:
    147
    Robert Klemme
    Sep 4, 2009
Loading...

Share This Page