3 ms·
Just because you mention Dart here, I want to point out what this would look like in Dart right now: queryAll(selector).forEach((e) => e.value = value); T
by spankalee 14y ago
Just because you mention Dart here, I want to point out what this would look like in Dart right now:
queryAll(selector).forEach((e) => e.value = value);
To me this is quite readable, and it's really nothing special about Dart, it's just that the dart:html library uses real Dart collections rather than the very unfortunate DOM NodeList.
To go even further into jQuery territory, there are bugs requesting that queryAll() return an ElementList that has setters that effect every element in the list, so we could do this:
queryAll(selector).value = value;
I'm on the fence about that. It's short, but a little magical. I'm sure jQuery fans would like to have it though.