LoginSignup
3
2

More than 5 years have passed since last update.

CoffeeScriptでRubyのArray#rejectするには

Posted at

Qiita良いさげ〜! 使ってみるテスト

CoffeeScriptでRubyのArray#rejectするには

array_reject.rb
a = [1,2,3,4,5]
a.reject {|v| v==3}
array_reject.coffee
a = [1,2,3,4,5]
n for n in a when n!=3
3
2
1

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
3
2