I have some browser sniffer code, using the function detect.jsdetect.js. It works fine when not added to my project. Still, but when I try to compile the jsJavaScript and addingadd it to app.js, I get an error in the console Uncaught ReferenceError: forEach is not defined at thisthe first line below, when refreshing the browser and attempt to detectdetecting the browser version.
Uncaught ReferenceError: forEach is not defined.
// Each Utility var each = forEach = function (obj, iterator, context) { if (obj == null) return; if (nativeForEach && obj.forEach === nativeForEach) { obj.forEach(iterator, context); } else if (obj.length === +obj.length) { for (var i = 0, l = obj.length; i < l; i++) { iterator.call(context, obj[i], i, obj); } } else { for (var key in obj) { if (_.has(obj, key)) { iterator.call(context, obj[key], key, obj); } } } }; https://github.com/darcyclarke/Detect.js/blob/master/detect.js
It seems like compiling the javascriptJavaScript is doing something to it. Any suggestions?