swap-reverse

0.0.1 • Public • Published

swap-reverse


A very fast algorithm for reversing strings and arrays.

More than 2 times faster compared to the native javascript Array.prototype.reverse().

  • tiny ( 394 bytes )
  • accepts strings and arrays
  • no dependencies
  • for modules and amd loaders
  • leaves Array.prototype.reverse untouched

___

usage:

var swapRev= require( 'swap-reverse' );
 
console.log( swapRev('!dlroW olleH') );
// Hello World!
 
console.log( swapRev([ 3, 2, 1 ]) );
// [ 1, 2, 3 ]

Package Sidebar

Install

npm i swap-reverse

Weekly Downloads

0

Version

0.0.1

License

GPL-3

Last publish

Collaborators

  • sygn