
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
array.prototype.reverse
Advanced tools
An ES5 spec-compliant `Array.prototype.reverse` shim/polyfill/replacement that works as far down as ES3.
An ES spec-compliant Array.prototype.reverse shim/polyfill/replacement that works as far down as ES3.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.
Because Array.prototype.reverse depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.
var reverse = require('array.prototype.reverse');
var assert = require('assert');
var a = [1, 2, 3];
assert.deepEqual(reverse(a), [3, 2, 1]);
assert.deepEqual(a, [3, 2, 1]);
var reverse = require('array.prototype.reverse');
var assert = require('assert');
/* when Array#reverse is not present */
delete Array.prototype.reverse;
var shimmed = reverse.shim();
assert.equal(shimmed, reverse.getPolyfill());
assert.equal(shimmed, Array.prototype.reverse);
assert.deepEqual([1, 2, 3].reverse(), reverse([1, 2, 3]));
var reverse = require('array.prototype.reverse');
var assert = require('assert');
/* when Array#reverse is present */
var shimmed = reverse.shim();
assert.equal(shimmed, Array.prototype.reverse);
assert.deepEqual([1, 2, 3].reverse(), reverse([1, 2, 3]));
Simply clone the repo, npm install, and run npm test
FAQs
An ES5 spec-compliant `Array.prototype.reverse` shim/polyfill/replacement that works as far down as ES3.
The npm package array.prototype.reverse receives a total of 3 weekly downloads. As such, array.prototype.reverse popularity was classified as not popular.
We found that array.prototype.reverse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.