Schoelman: Torkable: Well yes, but a better way to think about it is that it transforms a list into a new list via a function
Kalinoski: Yes I’m always “map”ping promises
Murley: So map makes it much easier to deal with the async flow
Pralle: Hey there. is anyone using babel for a library? I want to use it but I’m concerned about making users include polyfills. Is there any way to get around that?
Schouten: Hi! Odd question, does anyone know if there is a way to use js to detect if an element or its children are playing sounds?
Makarewicz: Kalinoski: Why are for loops better for mutations?
Elvis: You can break out of them.
Spinella: But otherwise you can filter then forEach/map which is usually more readable IMO
Goyette: You can break out with some, every, find
Burkhard: Depends on perf, for loops are great in critical sections
Daine: OtterCoder: querySelectorAll to get the video and audio elements, and check whether each is playing/muted
Elvis: Also for loops are better if you think you might have to change the loop to e.g. go by twos or something
Elvis: Or only iterate over some range intead of the whole array
Klemenc: Or when you’re dealing with arguments.
Goyette: I dont see the use case for that either
Checo: You can do that by chaining higher order functions
Popec: B/c doing anything other than arguments.length and argumentsi will cause deopt
Kalinoski: Ccapndave also sometimes you have to mutate the array itself
Schecter: Including .slice.callarguments, which I unfortunately see in far too many node libs
Kalinoski: Like splice out an element or change a single element
Pagano: Although this is a pattern that IMO v8 should recognize and optimize
Vanisouvong: Deltab: Thanks! What if there isn’t a nice, tidy selector? Does the webaudio api define anything?
Kalinoski: Sometimes it’s less complex to do it with for
Elvis: STRML: that’s true, but varargs is about convenience, and not performance.
Kolk: Yeah, if you really have to mutate the original array then for can make the most sense
Goyette: Most people don’t have those performance issues
Elvis: Webaudio api defines a ton of ****
Erling: Tcsc: depends, sometimes you have to use it e.g. in emitter libs
Jinkins: And I’ve seen a few of those using slice which is maddening.
Lacasa: OtterCoder: what about ‘video, audio’ as a selector? though I guess that woouldn’t work so well with iframes
Leskovar: But I find it rare you need to do that
Cass: Anyone here use gitlab ci to do their continuous integration?
Kalinoski: It always depends what you’re doing
Kalinoski: I rarely need to mutate anyway
Vafiadis: STRML: do you have a reference on that? anything but .length or referring to individual elements or arguments object calling deopt? I know working with it in general can, but I’ve never seen anything specific about what aspects of referencing it actually cause the deopt
Vafiadis: I honestly thought it was referencing it AT ALL that did it
Quider: You could check how chrome does its speaker icons in tabs, though that might not be something JS can access
Vafiadis: That and any additional costs you may incur using .call, apply, slice, etc on anything
Manny: Vafiadis: Petka is doing some work on this in v8, hopefully it will be a thing of the past. See https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments and the footnote at the end of section 3
Dueber: How is slice maddening for getting an array from arguments?
Sapp: I asked earlier, but does anyone here use rxjs?
Chubb: What would be the alternative
Moberley: There are more people here now