Implement Array.toReversed when browser does not implement it
The usage of Array.toReversed was added in 9b65bcce3d16. Closes #14270
This commit is contained in:
@@ -59,6 +59,16 @@ var Sao = {
|
||||
}
|
||||
}
|
||||
|
||||
if (!Array.prototype.toReversed) {
|
||||
Object.defineProperty(Array.prototype, 'toReversed', {
|
||||
value: function toReversed() {
|
||||
return this.slice().reverse();
|
||||
},
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
|
||||
Sao.setdefault = function(object, key, value) {
|
||||
if (!Object.prototype.hasOwnProperty.call(object, key)) {
|
||||
object[key] = value;
|
||||
|
||||
Reference in New Issue
Block a user