hyp-nice
Version:
redefine the javascript original class and add nice or handy method
36 lines (23 loc) • 470 B
JavaScript
nice = require('./nice.js');
function test_arr()
{
var arr = new Array("aa","bb","cc");
var str = arr.removeFirst();
console.log(str);
str = arr.removeFirst();
console.log(str);
//console.log(arr.toJSON());
}
test_arr();
function test_str()
{
s1 = " aa ";
console.log(s1.trim());
}
test_str();
nice.echo("echo test... ");
obj1 = {aa:"aaa",bb:'b1b1'};
json_str = nice.toJSON(obj1)
nice.echo(json_str);
obj1 = nice.fromJSON(json_str);
nice.echo(obj1);