打开主菜单

Ruby Programming/Reference/Objects/Array

< Ruby Programming

| Reference/Objects/Class →

類別方法

 方法: [ ]	 用法: Array[ [anObject]* ] -> anArray

將在[與]之間的元素建立成一個陣列。

  Array.[]( 1, 2, 3 ) -> [1,2,3]
  Array[ 1, 2, 3 ] -> [1,2,3]
  [1,2,3] -> [1,2,3]