SetJS:JavaScript中的Set(如数学中)实现

时间:2021-04-30 18:49:30
【文件属性】:
文件名称:SetJS:JavaScript中的Set(如数学中)实现
文件大小:25KB
文件格式:ZIP
更新时间:2021-04-30 18:49:30
JavaScript SetJS SetJS是的纯JavaScript实现,旨在高效执行差异(补码)和交点运算。 使用范例 var res ; var a = new Set ( [ 32 , 1 , 5 , 15 , 19 , 20 , 20 , 20 , 20 , 20 ] ) ; print ( a ) ; // "Set [1, 5, 15, 19, 20, 32]" var b = new Set ( [ 5 , 15 , 16 , 20 , 25 ] ) ; print ( b ) ; // "Set [5, 15, 16, 20, 25]"; res = b . difference ( a ) ; print ( res ) ; // "Set [16, 25]"; res = b . intersection ( a ) ; print ( res ) ; // "Set [5, 15, 2
【文件预览】:
SetJS-master
----MIT.LICENSE(1KB)
----.gitignore(10B)
----README.md(2KB)
----src()
--------Set.js(3KB)
----spec()
--------SetSpec.js(4KB)
----SpecRunner.html(1KB)
----lib()
--------jasmine-1.1.0()

网友评论