This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// uncomment if you are transpiling with Babel + Webpack | |
// const { window, document } = global; | |
/** | |
* Lightweight script to detect whether the browser is running in Private mode. | |
* | |
* You should use a polyfill for Promise. | |
* @see https://ourcodeworld.com/articles/read/316/top-5-best-javascript-promises-polyfills | |
* | |
* @returns {Promise} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Reference: https://stackoverflow.com/questions/7837456/how-to-compare-arrays-in-javascript/14853974 | |
*/ | |
// Warn if overriding existing method | |
if(Array.prototype.equals) | |
console.warn("Overriding existing Array.prototype.equals. Possible causes: New API defines the method, there's a framework conflict or you've got double inclusions in your code."); | |
// attach the .equals method to Array's prototype to call it on any array | |
Array.prototype.equals = function (array) { | |
// if the other array is a falsy value, return |