Keitsock: And once wasFound is true, that if statement returns true, and we always return true; thereafter
Pugel: Anyone ever play with restify?
Styron: Ok let me me re-read a few more times lool thanks for detailing it such Keitsock, now its all me to understand it
Strasser: Is there a polyfill that can make Promises available in IE8?
Keitsock: AramKaram: it might help to throw in some console.logs so you can see what the values look like each time through: http://jsfiddle.net/zmhg83us/
Keitsock: D2dchat: no, catch is a reserved word in IE8
Keitsock: And the spec implements it as .catch
Trohanov: Keitsock: so basically ie9+ then?
Keitsock: You can polyfill everything else afaik but .catch would break IE8
Keitsock: Yep, es6-shim supports IE9+
Gerrero: Keitsock: 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.
Mccallough: Keitsock aha, that example makes a lot of sense, Im copied your whole explanation and Ill read it a few times until I really understand it well enough, that was a clear and nice explanation thanks for that: this is how I see reduce works, Ive written down the logic, could you confirm if this how really it works? http://jsbin.com/tinosibiki/edit?js,output
Keitsock: D2dchat: if you must support IE8, and you can control all of your code that uses promises and don’t use any third party code that uses promises, you could do p’catch’function{ . } instead of p.catchfunction{ . }
Keitsock: I believe the polyfill itself wil work you just can’t ever write p.catch.
Keitsock: Exactly AramKaram! so the last piece of the reduce puzzle is teh “initial value”
Keitsock: If you don’t p*** an initial value, the first run through will read the first and second value. if you do p*** an initial value, the first run through will be initial value + first value
Keitsock: Which is the case in your “contains”, the initial value is false
Klusman: Ahhhh I think I got it : let me try to reread the whole thing to confirm if I really got it, but now I see things I didn’t notice before, like for one initial value being false
Gastello: Do the fiddle i create are stored somewhere ?
Ocallahan: Keitsock alright now I see for the most part : but there is still something I’m not sure about, at which point and how wasFound becomes true that’s what I can’t seem to understand? :-/ and initial value of it I see is p***ed as false but I don’t see what happens that it becomes true? sorry for asking too many questions
Keitsock: Smgs: if you hit save it will redirect you to a page with a unique url. that fiddle can permanently be found at that url
Gastello: Keitsock i am just running.
Gastello: Will it still be public?
Gastello: Keitsock let say i save one. so will that url be public or just to someone who know the url?
Keitsock: Public, to someone who knows that url
Keitsock: Afaik there’s no public repository of fiddles, you need to know the url
Gastello: Https://jsfiddle.net/zwu9c6sa/ ; i am trying to get this.
Gastello: Learning from here. http://stackoverflow.com/questions/1085801/get-selected-value-in-dropdown-list-using-javascript
Gastello: But cannot select the last item/2nd item from the drop down
Keitsock: E.titleIndex is undefined
Gastello: Hmm. what to put in there the. 00000 part ?
Keitsock: You can just do e.value to read teh value from the actively selected element
Keitsock: Otherwise not sure what you’re trying to do
Gastello: Keitsock, want to select the 2nd item from the drop down list.
Keitsock: Well, you can select teh *second* item by e.options1
Keitsock: But if you want the *active* item, e.value will return that value
Gastello: Keitsock did you run that fiddle ?