But basically, prefer array.

Aschbacher: Sorry this might be off-topic, although I am using js

Kerbel: Yeah not really a JS question. I would look at maybe a token which is expiring from request to request

Kerbel: Otherwise, right lcick the request in network tab and “copy curl”

Kerbel: That should give you an identical “curl” command that duplicates the request via command line

Aschbacher: My sc****r is actually getting rather advanced. it saves its sessions, and it also evaluates the JS on the pages it sc****s in order to modify the cookies appropriately for the next request

Aschbacher: There are tons of tokens the site uses but I have them all

Lulow: When running npm install, why does it default to global modules and not create a node_modules/ folder? I’m using npm 2.11.3

Stoutenger: Debian jessie stable, using the nodejs repos

Hender: Nirakara: how many packages have you had to compile by hand? *offtopic*

Hender: And how many did you have to pull in from testing ooc?

Buskirk: Lotus, i’m not sure what you’re on about

Buzzi: Nirakara: npm install defaults to local install, so I’m not entirely sure what you meant

Buzzi: Nirakara: you have to specifically use the -g flag to make it global

Norwell: Zap0: what kind of comparisons?

Ginnings: Nirakara: you probably have global = true in your npm config

Ginnings: Nirakara: npm help config

Hender: Nirakara: deb stable vs deb testing vs deb unstable ;

Zuhlke: Lotus, it wasn’t too bad

Goodnoe: Is there a reason why you would *not* want to use ! to convert something into a Boolean? I remember reading somewhere advising against doing this but I can’t find it right now.

Konopacki: Games: The ‘falsy’ values in JavaScript are undefined, null, 0, -0, NaN, ”, and false. The ‘truthy’ values are all other values. All objects are truthy. There is nothing both truthy and falsy, or neither truthy nor falsy.

Liptrap: Dolby, 0 to 9999.1234 4 decimal places

Kinnier: Zap0: multiply those by 10000 and compare integers instead

Angustia: Games: are you saying it’s unnecessary to convert values into Booleans?

Naufzinger: Ms7: there’s none. But you can just use the Booleanx function instead.

Kissling: Dolby: all right, must have been an implanted memory then. Thanks

Steidl: Which is very handy for HOFs, like: a, b, c.mapBoolean, instead of a, b, c.mapfunctionx{ return !x }

Skorcz: Dolby: wow, that’s a cool trick

Dorian: I wouldn’t really call it a trick but eh

Daudelin: What Javascript Doesn’t Want You To Know About This HOF Hack

Konopacki: Yansanmo: object 1, 2, 15

Kindt: Dolby: that’s really useful, thanks

Gallaway: If I have a for loop that iterates through an array of objects, is it worth storing the length of hte array outside of the for loop?

Carathers: Cba, but in general you should store it outside the loop.

Estorga: Mbrzuzy: depends. Are you mutating the length anywhere?

Wetzler: Dolby, what do you mean by that?

Treacy: Mbrzuzy: e.g.: you remove or add elements to the array.

Wison: I see. Well not when I’m iterating through, no

Adickes: Mbrzuzy: anyway, you should be probably using the Array iteration methods. They’re more useful than for loops. And better, most of the time. As for for loops, you want to cache anything that is computationally intensive. The length property on arrays is not. In fact, caching the length property is going to make your loop slower.

Riddlebarger: In v8, at least. Because now v8 needs to waste one register and juggle memory around because you’ve decided to cache a value it has to check at each loop iteration anyway, because it needs to do bounds checking

Battiata: But basically, prefer array.filter/array.map/array.reduce over array.forEach over for . { . } over while . { . }, whenever possible