As opposed to the less powerful Arduino, the competitively priced and WiFi-enabled ESP8266 supports the Web-of-Things (WoT) since it can be programmed in JavaScript.
Don't confuse a DOM collection with a JS array: Array functions, such as the forEach looping method, cannot be applied to a DOM collection!
For instance, when you retrieve all rows of an HTML table element, you get an HTMLCollection, which is an array-like object, but not an instance of Array, and therefore the following code does not succeed because the Array method forEach is not defined for an HTMLCollection like myTableEl.rows: