zoukankan
html css js c++ java
javascript中实现的hashtable
function
Hashtable()
{
this
._hash
=
new
Object();
this
.add
=
function
(key,value)
{
if
(
typeof
(key)
!=
"
undefined
"
)
{
if
(
this
.contains(key)
==
false
)
{
this
._hash[key]
=
typeof
(value)
==
"
undefined
"
?
null
:value;
return
true
;
}
else
{
return
false
;
}
}
else
{
return
false
;
}
}
this
.remove
=
function
(key)
{
delete
this
._hash[key];}
this
.count
=
function
()
{
var
i
=
0
;
for
(
var
k
in
this
._hash)
{i
++
;}
return
i;}
this
.items
=
function
(key)
{
return
this
._hash[key];}
this
.contains
=
function
(key)
{
return
typeof
(
this
._hash[key])
!=
"
undefined
"
;}
this
.clear
=
function
()
{
for
(
var
k
in
this
._hash)
{
delete
this
._hash[k];}
}
}
var
a
=
new
Hashtable();
a.add(
"
aa
"
);
a.add(
"
bb
"
,
2342
);
a.add(
"
bb
"
,
2342
);
a.remove(
"
aa
"
);
alert(a.count());
alert(a.contains(
"
bb
"
));
alert(a.contains(
"
aa
"
));
alert(a.items(
"
bb
"
));
查看全文
相关阅读:
使用微软WPF技术开发产品优势究竟在那里
北京地铁的众生相,发上来和大家分享(北京白领生活真实写照)
长期提供WindowsPhone7培训 & HTML5培训 & Silverlight培训 & WPF培训
Silverlight中开发和设计人员的合作
Silverlight 动态调用 WebService
(学)Lazarus 在 WinCE 下如何取消标题栏上的 OK 或 X 按钮
(学)新版动态表单研发,阶段成果4
(学)新版动态表单研发,阶段成果5
(原)Lazarus下WinCE终端、服务器心跳监控(Ping)源码
(原)Lazarus 在 Thread 中使用 SQLQuery 查询Oracle 会出现异常
原文地址:https://www.cnblogs.com/jacktu/p/1011504.html
最新文章
楼市调控要“围堵”更要“疏通”
Silverlight5正式候选版发布附下载地址(Silverlight 5.0 RC)
微软将于下周展示平板电脑操作系统
Silverlight工具荟萃
Silverlight调用Visfire开源图表组件的源代码
于娟——《活着就是王道》博客精华文摘
Windows 8将用HTML5和JavaScript开发应用
诺基亚将于10月26日发布首款WindowsPhone7手机
WPF与Silverlight技术异同整理总结【附英文原文和PPT】
微软:Windows 8触摸界面与iPad一样简洁(图)
热门文章
JBL无所不能与IPhone4、IPad2的完美盛宴
人际关系经验(绝对有用)
盗版致微软损失数十亿美元
一个老板的三句话,不看后悔几辈子。
ASP.Net服务器应用程序不可用的解决方法
Silverlight 苹果风格按钮Mac OS Style 实现的更新版
关于近视眼手术网友的评价
Silverlight OA源代码(Silverlight4+SQLServer2005
猫头鹰当宠物?好看不好养
分析:微软最终将赢得平板电脑市场的5个理由
Copyright © 2011-2022 走看看