Icontem

File: example/example3.js

Recommend this page to a friend!
  Classes of ryan silalahi  >  Encyclopedia  >  example/example3.js  >  Download  
File: example/example3.js
Role: Example script
Content type: text/plain
Description: Example script
Class: Encyclopedia
Store large objects in many smaller ones
Author: By
Last change:
Date: 4 years ago
Size: 648 bytes
 

Contents

Class file image Download
var enc = require('./..');

var test = enc();

var max = 10;
for(var i = 0; i < max; i++){
	test.set(i, i);
}

for(var i = 0; i < max / 2; i++){
	test.unset(i);
}


for(++i; i < max + max; i++){
	test.set(i, i);
}

test.walk(function(k, v){
	console.log(k + ' => ' + v);
});

console.log('now length: ' + test.getLength());


/*
var enc = require('./..');

var test = enc();

var max = 5;
for(var i = 0; i < max; i++){
	test.set(i, i);
}

test.unset(4);
test.unset(5);
test.unset(6);


for(++i; i < max + max; i++){
	test.set(i, i);
}

test.walk(function(k, v){
	console.log(k + ' => ' + v);
});

console.log('now length: ' + test.getLength());
*/