So this ‘if’ isn’t an.

 
Setter: I had to use bit logic to make a buffer that could use bits instead of bytes

Wojtanowski: If ~”abc”.indexOf”d” { true } else { false}

Regier: That way if it finds nothing and returns -1, the ~ will make it into 0, which evaluates as false

Wojtanowski: If ~”abc”.indexOf”b” { true } else { false}

Wojtanowski: But that’s *really* *really* unreadable. ;

Neiderhiser: I would file that away under “cryptic performance hack”

Wojtanowski: If “abc”.indexOf”d” !== -1 { true } else { false} is much more readable.

Wojtanowski: And when you can use ES6’s library support. “abc”.includes”d” would work better.

Autery: So in short, don’t use it

Mate: Gentleman: To get every backwards-compatible feature of ES6 in every browser and node, use https://www.npmjs.com/package/es6-shim ! It’s heavily tested, comes with Promises, and using the !es5-shim as well is strongly encouraged.

Gentleman: You can use String#includes now :-

Wojtanowski: Annoymouse: Why use when you can !==?

Wojtanowski: Gentleman: Bah, I refuse to use es6-shim.

Gersten: Havvy: Less chars. that was the bloggers justification for using tilde in the first place

Wojtanowski: It’s not worth it in download size.

Wojtanowski: At least for what it gives.

Gentleman: Havvy: i’m not really sure what you mean – it’s relatively small, and it gives you a ton of new API

Gentleman: Map, Set, Promise, new Array methods, including Array.from…

Gentleman: And more importantly, it fixes bugs in browsers’ current implementations of them

Wojtanowski: I can use Object.createnull as a Map for when I need maps most of the type. I haven’t really needed sets that often in JS. The new array methods are nice, but not entirely necessary.

Wojtanowski: If I’m going to have a non-environmental promise, it’s going to be bluebird.

Gentleman: You can’t use Object.createnull for object keys

Sable: Es6 has object keys? so sexy

Gentleman: Timetocode: ES6 Map does.

Gentleman: Array.from, Array#find, Array#findIndex, and Array#fill are the most useful array methods in ES6 imo

Elio: I want to add an api to one of my libs such that people can write myLib.on’update’, someUserCode. I haven’t made something like that before. what woudl it be basically. an event emitter and adding a listener that use someUserCode as the callback.?

Landreth: Also is there a particular merit to blah.onErrorcb vs blah.on’error’, cb ?

Hernandes: It seems like jquery had the former, and now has the latter

Gentleman: The latter is consistent with the node EventEmitter API

Gentleman: And with DOM’s addEventListener

Vives: Oh the .on function is straight up part of the event emitter. i seeeeeeeee

Defusco: What does “if style.styleSheet” mean, I can’t seem to get to evaluate to true. I’m presuming that it’s something to do with style having the property styleSheet

Defusco: I’m not sure if that’s something that kinda needs the context or not either tbh

Defusco: Sillyslux: contrived and colvoluted thing that I was just doing for learning https://jsfiddle.net/v8p0xdLu/

Defusco: You can see the ifs at the end where I was trying to see whether they would evaluate, but they didn’t

Defusco: Sillyslux: how come the flag var doesn’t get incremented then?

Defusco: I was following along with it in the firefox debugger and it never went in those if conditions or incremented the flag var

Parido: There is style.sheet.cssRules0.cssText

Defusco: Sillyslux: Ok – so that’s something thats ‘given’ with the browser? And thats just a chrome thing

Sanabria: Or yes, i don’t see it in ff

Kvilhaug: Arrg sorry, yes it’s available in ff too

Defusco: So this ‘if’ isn’t an obvious ‘thing’? I’m trying to work out what the point in it is, as I can never get it to actually enter the if statement . like the append section puts the CSS var into the DOM / HTML / whatever bit, but that other bit’s confusing me