A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members) or send an e-mail to admin@wiki.whatwg.org with your desired username and an explanation of the first edit you'd like to make. (Do not use this e-mail address for any other inquiries, as they will be ignored or politely declined.)

IDL

From WHATWG Wiki
Jump to: navigation, search

sequence

  • As return value always returns a new JavaScript Array.
  • Better than [] for methods and dictionaries taking arrays.

[]

  • When a method returns a [] it either returns a new copy or the same.
    • The returned object is not a JavaScript Array.
    • If the returned object is declared readonly it can still be manipulated by the browser, unlike a frozen JavaScript Array.
  • In general this is probably better avoided. There's a desire expressed to kill [] and only use JavaScript Arrays.