Macrowski: Kearby, that reduce and each look kind of verbose.
Rappley: Macrowski why is that though? to me they actually look as minimalistic as possible, indeed a few lines could have been cut out but still looks fine to me :
Macrowski: Kearby, well, perhaps not the each, since you are doing object iteration as well, but this seems to be a job for two different functions
Destasio: What are some things that you can do server-side to ward off automated requests to your website
Shaff: Macrowski well yeah perhaps each sure could of been cut out a few lines, we could completely strip out iterating over objects part since not what bultin foreach does :
Caren: Macrowski do you have an answer for my above question by any chances? can you see how and when does wasFound value changes from false to true? can’t seem to figure that out for a few days already :-/
Macrowski: Kearby, it will change to true as soon as item === target
Macrowski: The reduce operation looks for the item, if found it p***es true along
Macrowski: So it only has to find it once, then it is good, and just ignores everything, keeps p***ing true and that’s the result
Kimple: Well, it looks like i found a new way to lock up a browser to the point where i cant even quit it
Kimple: Apparently if i draw 32k full screen quads, it doesn’t like that.
Siniscalchi: Macrowski but this if wasFound statement should at some point satisfy the condition so it can go ahead and return true right? but since wasFound is false and whenever item === target that doesn’t make wasFound true though?
Klaiber: Funny how we say the same answer to the same question
Klaiber: Kearby, wasFound is false in first iteration, then it’s item === target in the second iteration
Macrowski: Kearby, as soom as item===target, wasFound===true
Macrowski: Blet reduce=f,acc,x,.xs=x==null?acc:fx,reducef,acc,xs; reducex,y=x+y,0,1,2,3
Macrowski: Valentia not working?
Greenwald: Ahhhhhhhhhh: goooottttt iiittttt !
Bumm: Macrowski: Faville was looking into it, but he also seems to be not here :’
Macrowski: Kearby, lol, everybody gets this aha moment, it is normal
Macrowski: Reduce is incredibly useful
Lilyblade: Macrowski Klaiber Neonakis thanksss y’ll : it just clicked it and I got it right freaking away! 😀
Dedaj: Aha I see it now Klaiber :
Klaiber: So if you have “a”,”b”,”c” it will do : fff”a”,”b”,”c”
Klaiber: Wait. I missing the first value
Klaiber: So if you have “a”,”b”,”c” it will do : fff”the first value”, “a”,”b”,”c”
Rippetoe: Aha that makes sense, now I see it, and also have copied this whole explanation into my notes since it made a lot of sense, thanks again :
Klaiber: If you don’t have an initial value, it will take the first item in the array as the initial value
Destasio: How can I fend off these pesky bots beleaguering my website? I’ve already tried timing the requests but they are well timed
Macrowski: Kearby, if your operation is pure, then you can always do this equational reasoning, and unpack it
Gilland: Aha, at first I didn’t get that part as well lol then I realized it automatically gonna ***ign arrays first element to it and skip that element and never iterate over it
Feeny: Macrowski aha, just takes a lot of thinking though, I was struggling with this function for 3-4 days, and probably wouldn’t understand it if it wasn’t for y’ll, I simply couldn’t see whats happening, Im so happy to have y’ll in here 😀 people in here helped me a lot lol
Macrowski: Repl.it is nice, but I can’t ever change the font on Ace editor properly with CSS
Caller: Ahh I didn’t know about that issue :-/ Ive been using it just for its console feature, just for testing purposes