function table_print(t) { foreach(t, function(key, value) { log(key, " -> ", value) }) } function table_copy(t) { var t2 = {} foreach(t, function(key, value) { t2[key] = value }) return t2 } # #return the number of value in table # function count(table,value){ var number=0 var i=0 while(i