Icontem

File: example/example5.js

Recommend this page to a friend!
  Classes of ryan silalahi  >  Encyclopedia  >  example/example5.js  >  Download  
File: example/example5.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: 351 bytes
 

Contents

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

var odd = enc();
var even = enc();

var max = 10;
for(var i = 0; i < max; i++){
	
	if(i % 2 == 0)
		even.set(i, i);
	else
		odd.set(i, i);
}

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

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