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 Chat (such as one of these permanent autoconfirmed members).

IDL

From WHATWG Wiki
Jump to navigation Jump to 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.