cherry.js is a JavaScript utility library, and it can run on both browser and Node. You can use javascript more easily with cherry.js. The sample follows:
Just include this script for using:
<script src="cherry.min.js"></script>
And enjoy cherry.js:
var arr = ['a','b','c','d'];
arr.$swap(0,2);
console.log(arr); //return ['c','b','a','d'];
var obj_1 = { a:{b:1}, c:[1,2,3] };
var obj_2 = { a:{b:1}, c:[1,2,3] };
console.log( obj_1===obj_2 ); //return false;
console.log( obj_1.$equal(obj_2) ); //return true;
npm install --save-dev cherry.js
require('cherry.js');
var arr = ['a','b','c','d'];
arr.$swap(0,2);
console.log(arr); //return ['c','b','a','d'];
Home Website: http://cherry.jerryzou.com