本文簡要介紹ruby語言中 Array.hash
的用法。
用法
hash → integer
返回 self
的整數哈希值。
具有相同內容的兩個數組將具有相同的哈希碼(並且將使用 eql 進行比較?):
[0, 1, 2].hash == [0, 1, 2].hash # => true
[0, 1, 2].hash == [0, 1, 3].hash # => false
相關用法
- Ruby Array.push用法及代碼示例
- Ruby Array.to_a用法及代碼示例
- Ruby Array.to_h用法及代碼示例
- Ruby Array.to_s用法及代碼示例
- Ruby Array.array + other_array用法及代碼示例
- Ruby Array.take()用法及代碼示例
- Ruby Array.reject!用法及代碼示例
- Ruby Array.flatten!用法及代碼示例
- Ruby Array.reject用法及代碼示例
- Ruby Array.repeated_permutation()用法及代碼示例
- Ruby Array.index()用法及代碼示例
- Ruby Array.pack()用法及代碼示例
- Ruby Array.rassoc(obj)用法及代碼示例
- Ruby Array.values_at()用法及代碼示例
- Ruby Array.each用法及代碼示例
- Ruby Array.fetch用法及代碼示例
- Ruby Array.flatten用法及代碼示例
- Ruby Array.sort用法及代碼示例
- Ruby Array.unshift()用法及代碼示例
- Ruby Array.reverse用法及代碼示例
- Ruby Array.array | other_array用法及代碼示例
- Ruby Array.rotate()用法及代碼示例
- Ruby Array.rindex用法及代碼示例
- Ruby Array.replace()用法及代碼示例
- Ruby Array.slice!用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 Array.hash。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。