onlycode.org

javascript
jquery
html
angularjs
css
node.js
ajax
html5
php
json
arrays
google-chrome
dom
regex
reactjs
ecmascript-6
javascript-events

your's history:
array state will be cach...

Array state will be cached in iOS 12 Safari. Is it a bug or feature, just only code?

ios12 | safari | ios | javascript

edit
(function() {
  function getReverseStr() {
    return [1, 2].reverse();
  }

  var n1 = getReverseStr()[0];
  var n2 = getReverseStr()[0];
  // check if there is an issue
  if(n1 != n2) {
    var origReverseFunction = Array.prototype.reverse;
    Array.prototype.reverse = function() {
      var newArr = this.slice();
      // use original reverse function so that edge cases are taken care of
      origReverseFunction.apply(newArr, arguments);
      var that = this;
      // copy reversed array
      newArr.forEach(function(value, index) {
        that[index] = value;
      });
      return this;
    }
  }
})();

26
Shubhansh, 20.09.2018 19:05

Add your just only code

your name:    



If you need full text click here

Some similar links Array state will be cached in iOS 12 Safari. Is it a bug or feature? ↓:
drawImage ratio bug iOS

How to open Safari from a WebApp in iOS 7

Is Safari on iOS 6 caching $.ajax results?

Prevent orientation change in iOS Safari



This project is created for those who just need only code, wihout maaaaaaaaaaany words.