In Chrome's Debugger's Console window, I'd like to convert (sort of flatten) an array to string, like this:
<div class="foo">
<div class="bar">a</div>
<div class="bar">b</div>
</div>
and get this result:
a b
This works but seems like a hack:
var arr = $x('//*[@class="foo"]/descendant-or-self::*/text()')
for (i in arr) { console.log(arr[i].data); };
But text()
, of course, returns an array, whereas I just want the text.