| | 1681 | == [ArrayClass](i) == #ArrayClass |
| | 1682 | |
| | 1683 | * [http://dev.w3.org/2006/webapi/WebIDL/#ArrayClass The spec of ArrayClass] |
| | 1684 | |
| | 1685 | Summary: Allows an interface to extend JavaScript arrays. |
| | 1686 | |
| | 1687 | Usage: [ArrayClass] can be specified on interfaces. An interface may not both have [ArrayClass] and extend another interface. |
| | 1688 | |
| | 1689 | The bindings for the interface will have the `[[Prototype]]` of the constructor prototype set to `Array.prototype` which means that the methods defined on JavaScript arrays work on the instances of this interface. |
| | 1690 | |
| | 1691 | {{{ |
| | 1692 | // IDL |
| | 1693 | interface [ |
| | 1694 | ArrayClass, |
| | 1695 | IndexedGetter |
| | 1696 | ] NodeList { |
| | 1697 | Node item(in unsigned long index); |
| | 1698 | readonly attribute unsigned long length; |
| | 1699 | } |
| | 1700 | |
| | 1701 | // JS |
| | 1702 | myNodeList instanceof Array // true |
| | 1703 | myNodeList.forEach(function(node) { console.log(node_; }); |
| | 1704 | }}} |
| | 1705 | |