加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Ruby:Hash.keys和Hash.values方法返回的键/值的顺序是什么?

发布时间:2020-12-16 20:20:08 所属栏目:百科 来源:网络整理
导读:将项目添加到哈希中的顺序是否相同? 解决方法 the Ruby 1.9.2 documentation for the Hash class的顶部声明: Hashes enumerate their values in the order that the corresponding keys were inserted. 粗略测试表明,这确实适用于Hash#键和Hash#值,尽管这
将项目添加到哈希中的顺序是否相同?

解决方法

the Ruby 1.9.2 documentation for the Hash class的顶部声明:

Hashes enumerate their values in the order that the corresponding keys were inserted.

粗略测试表明,这确实适用于Hash#键和Hash#值,尽管这些方法的相应文档似乎没有指定.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读