Miss any of our Open RFC calls?Watch the recordings here! »

reverse-value

1.0.0 • Public • Published

reverse-value (Reverse Everything)

This library reverses all possible variables

Variable types

  • String
  • Number
  • Array
  • Boolean

Installation

npm install reverse-value

Usage

reverse(value)

const rev = require('reverse-value');
 
console.log(rev.reverse( 'qwe' ));      //  ewq
console.log(rev.reverse( 1992 ));       //  2991
console.log(rev.reverse( true ));       //  false
console.log(rev.reverse( false ));      //  true
console.log(rev.reverse( ['asd', 12, 'www', 'qwe'] ));      //  ['qwe', 'www', 12, 'asd']
 
console.log(rev.reverse( null ));       //  null    - Remains same
console.log(rev.reverse( undefined ));  //  undefined   - Remains same
console.log(rev.reverse( { a: 'asd', b: 'qwe' } ));       //  { a: 'asd', b: 'qwe' }    - Remains same

Install

npm i reverse-value

DownloadsWeekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.38 kB

Total Files

3

Last publish

Collaborators

  • avatar
  • avatar