请问在JAVASCRIPT中有没有结构类型?

gully 2001-10-23 04:03:39
...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
gully 2001-10-25
  • 打赏
  • 举报
回复
谢谢了!
karma 2001-10-24
  • 打赏
  • 举报
回复
the basic struct type in Javascript is Object, and you can build your own structure like this:

<script>
function MyStruc()
{
this.prop=0;
this.id="xyz";
}

var x = new MyStruc();
alert(x.id);
alert(x.prop);
x.id="www";
x.prop=122;
alert(x.id);
alert(x.prop);
</script>
gully 2001-10-23
  • 打赏
  • 举报
回复
没人知道么?

10,606

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧