LoginSignup
16
16

More than 5 years have passed since last update.

Scala, Ruby, underscore.js でコレクションメソッドの対応表

Posted at

自分用。
違うくね?とか漏れてるとかあったらプルリクエストください!

Scala 2.10 Ruby 2.1 underscore.js
List(1,2,3) [1,2,3]
l(0) l[0], at
combination
collect
count count countBy
contains include?,member? contains, include
diff
drop drop
dropRight
dropWhile drop_while
exists any? any,some
endWith
filter select find,filter
filterNot reject reject
find find
flatten flatten flatten
flatMap
foldLeft inject
foldRight
forAll all? all,every
foreach each
groupBy group_by groupBy
grouped
head first first
headOption
init
indexOf index indexOf
indexWhere
isEmpty empty?
last last last
lastOption
intersect & intersect
map collect,map map
max max max
maxBy max_by
min min min
minBy min_by
nonEmpty
par
partition partition partition
product
reduceLeft reduce reduce
reduceRight reduceRight
reverse
scan
size size,lenght
slice slice
sortWith
span
splitAt
sum
tail tail tail,rest
take take
takeWhile take_while
union union
unzip
view
zip zip zip
zipWithIndex
none?
each_with_index
each_index
one?
minmax
grep
delete
delete_at
shuffle shuffle
permutation
fill
where
invoke
pluck
sample
compact
difference
uniq
object
16
16
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
16