Safari 12 version, javascript Array.reverse() cache

const numplace = ['0', '00', '000', '0000'];


const r = numplace.reverse();


Today, after upgrading iOS 12, I inadvertently found that the order of the arrays was wrong.

The first load is normal, the page refresh is reversed, the refresh is normal, the refresh is reversed, and so on...,

The problem arises in Safari 12, as if the variables are "cached" by Safari, and even refreshing the page is preserved and inherited.


Is this a bug or feature in iOS 12 Safari? Where can you see the changes to the underlying mechanism of safari?

Replies

Yes, it's a bug. We are discussing on stackoverflow: https://stackoverflow.com/questions/52390368/array-state-will-be-cached-in-ios-12-safari-is-bug-or-feature/52392901#52392901


And also we release a js shim to fix this bug: https://github.com/fanmingfei/array-reverse-ios12