Ruby - elegantly convert variable to an array if not an array already

前端 未结 0 1028
独厮守ぢ
独厮守ぢ 2020-12-23 03:46

Given an array, a single element, or nil, obtain an array - the latter two being a single element array and an empty array respectively.

I mistakenly figured Ruby wo

相关标签:
回答
  • 消灭零回复
提交回复
热议问题