refactor Node.ts

use Array#forEach()
refactor