6 ms·
Cool idea, but kind of ironic that the example you used produces unnecessarily complicated stack overflow solutions. A JavaScript "contains" function is as simp
by WithTeeth 11y ago
Cool idea, but kind of ironic that the example you used produces unnecessarily complicated stack overflow solutions. A JavaScript "contains" function is as simple as:
var contains = function (needle, haystack) { return haystack.indexOf(needle) !== -1 }
- ne0phyte 11y agoOlder IEs don't have Array.indexOf(). So you either have to extend the Array prototype or, you know, just implement it in a more compatible way.
- CiPHPerCoder 11y agoOr just not support older IEs. http://browserupdate.org/ http://browserupdate.org/
- romanovcode 11y agoMaybe the likes of you someday will get a job and then understand that "what you support" does not depend on you.
- extrapickles 11y agoWhat I do, is provide nwjs to those on old versions, so they think they are getting the "application" version, but in reality, its Chromium hard coded to only goto the web application. So far its a win for both parties, since they are not installing another browser than can interfere with some silly IE6 only internal enterprise site and we get to use the latest browser features.
- dang 11y agoPlease don't post uncivil comments here.
- romanovcode 11y agoYea I'm sorry but it just gets on my nerves when people post things like "just don't support it!". I would if I could, everyone would if they could.
- dang 11y agoBelieve me, I understand how comments like that get on one's nerves. But civil discourse requires those of us with nerves to tolerate the irritation enough not to toss it back. The system has no steady state: the irritation either grows or we dampen it.
- habith 11y ago> Older IEs don't have Array.indexOf() IE8 and older to be specific[0]. But, if you're supporting IE8 still you have bigger problems at hand. Microsoft stopped supporting any version lower than IE11 as of January 12th of this year[1]. So unless all of those older IE machines are accessing an intranet (and only an intranet) their risk of being hit with malware is way higher than average. For my clients I do a cursory IE9+ review, but if anything lower is a requirement then it's an additional fee to make a site work with it. In a few months it'll be IE11+ and the same fee structure will apply to anything lower (I'm just waiting for IE10 to wind down a bit). [0] http://caniuse.com/#search=array.indexof http://caniuse.com/#search=array.indexof [1] https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE...
- pferde 11y agoYou should submit this to SO, so that future developers can have it autocompleted in their projects.