سؤال

I want to call "map" over all the children of an element, but goog.dom/getChildren does not always return an object that can be sequenced. Is there any other way to do this?

هل كانت مفيدة؟

المحلول

I would combine goog.dom/getChildren with prim-seq. prim-seq makes seqs out of JavaScript objects which can be indexed like arrays and have a length property. I would leave extending native types alone in this particular case.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top