我通过rubocop运行我的代码.它有一个规则: %w或%W一组单词.
%w
%W
%w(some words here) ['some', 'words', 'here']
为什么要%w受到青睐['some', 'words', 'here']?两者似乎都是平等的.它只是减少打字,还是我们为了混淆而试图变得神秘?
['some', 'words', 'here']
ruby coding-style rubocop
coding-style ×1
rubocop ×1
ruby ×1