5 ms·
Ignoring the fact that that's a stupidly large payload for a statically displaying two words, the JS code in there is weird. I mean, who comments code like this
by milliams 2y ago
Ignoring the fact that that's a stupidly large payload for a statically displaying two words, the JS code in there is weird. I mean, who comments code like this:
// 23.1.3.33 Array.prototype.toReversed ( )
CreateMethodProperty(Array.prototype, 'toReversed', function toReversed() {
// 1. Let O be ? ToObject(this value).
var O = ToObject(this);
// 2. Let len be ? LengthOfArrayLike(O).
var len = LengthOfArrayLike(O);
// 3. Let A be ? ArrayCreate(len).
var A = ArrayCreate(len);
// 4. Let k be 0.
var k = 0;
// 5. Repeat, while k < len,
while (k < len) {
// a. Let from be ! ToString((len - k - 1)).
var from = ToString(len - k - 1);
// b. Let Pk be ! ToString((k)).
var Pk = ToString(k);
// c. Let fromValue be ? Get(O, from).
var fromValue = Get(O, from);
// d. Perform ! CreateDataPropertyOrThrow(A, Pk, fromValue).
CreateDataPropertyOrThrow(A, Pk, fromValue);
// e. Set k to k + 1.
k = k + 1;
}
// 6. Return A.
return A;
});
- itsharshyeh 2y agoIs this the reason why ThePrimeAgen left Netflix??? 0.0
- deleted 2y ago[deleted]
- phantomathkg 2y agoThey must be using this service. https://github.com/polyfillpolyfill/polyfill-library/blob/main/polyfills/Array/prototype/toReversed/polyfill.js https://github.com/polyfillpolyfill/polyfill-library/blob/ma...