Mate: Gentleman: string ‘b’
Gentleman: Good lord that’s horrific
Nogueira: Gentleman: I just found a lot more easer method
Haverstock: Http://fiddle.jshell.net/4z4m9rpv/1/
Trimble: Hylle: haha thats sketchy.
Farese: It was probably a bug that had to be put in the spec for backwards compatibility
Chwalek: Gentleman: yay, js is now the 4th language I know with “p*** by reference” semantic =
Gentleman: Deniska: JS is strictly p*** by value.
Markland: Like someone just made arguments = whateverStructTheyUsedForRepresentingTheLocals
Gentleman: Deniska: the fact that mutating the arguments object triggers a binding does not make JS “p*** by reference”
Lewark: Deniska: It’s just that the ‘value’ of objects is actually a pointer.
Mate: Deniska: JavaScript has call-by-value semantics in which references to objects are considered to be a type of value. Direct ***ignment to an argument will never be visible outside of a function. For a detailed explanation, see: http://www.jon-carlos.com/2013/is-javascript-call-by-value-or-call-by-reference/
Mate: Hylle: Changed p*** by value to: JavaScript has call-by-value or call-by-sharing, more specifically semantics in which references to objects are considered to be a type of value. Direct ***ignment to an argument will never be visible outside of a function. For a detailed explanation, see: http://www.jon-carlos.com/2013/is-javascript-call-by-value-or-call-by-reference/
Esskew: Yeah, kind of more like p***ing a scary implicit pointer to local var
Dorchy: God dammit it absolutely reeks in here
Nockels: Http://jsfiddle.net/yxmmrw21/ — would this be about the most correct way to get the ‘Texts’ value from each page into a single big array?
Gentleman: Gillice: that works fine, sure. alternatively you could .map and then flatten
Corker: Gentleman: Yeah, that’s what I did at first because I got a bit lost with how .reduce was supposed to work. This seems more straight forward
Gentleman: Well – map + flatten is more straightforward, i’d argue.
Gentleman: But certainly your reduce is more efficient.
Gentleman: Personally i’d start with the map + flatten, and then optimize it to the reduce if profiling proved it was the slowest part of my program.
Gentleman: But the reduce is cool too
Gentleman: With something like lodash’s laziness, you could do a lazy map + flatten and it would combine to a reduce under the hood
Susong: Wouldn’t I still use reduce to flatten it?
Gentleman: But it’s still a separate abstraction
Gentleman: Essentially what you want is a “flatMap” where it’s a map, but it flattens as it goes.
Gentleman: That way you could represent it as flatMappages, function page { return page.Texts; }
Tabb: Gentleman: I’d have to write said function?
Mate: Gentleman: function flattenarr { return arr.reducefunction flat, toFlatten { return flat.concatArray.isArraytoFlatten ? flattentoFlatten : toFlatten; }, ; };
Cobert: It just seems so unnecessary
Footer: I mean isn’t this within the scope of what reduce is for :p
Gentleman: Function flatMaparr, mapper { return arr.reducefunction flat, toFlatten { toFlatten = mappertoFlatten; return flat.concatArray.isArraytoFlatten ? flattentoFlatten : toFlatten; }, ; };
Stuller: I’m not even quite sure what’s happening there
Ve: This is a general function that doesn’t necessarily ***ume it’s an array of arrays?
Gentleman: Gillice: it says, if it’s an array, flatten it recursively
Lucario: I’ll look into that properly another time
Gutschow: Atm I’m not getting paid enough :p
Gentleman: It doesn’t map recursively tho
Gobin: Seems simple enough actually
Quasdorf: I just don’t see the need to use it atm
Greenley: The output of pdf2json is confusing