104. Traverse DOM level by level

easy  - accepted / - tried

Given a DOM tree, flatten it into an one dimensional array, in the order of layer by layer, like below.

Bugfree ordinary solution is better than buggy fancy ones.

(2)
(118)