Skip to content

Instantly share code, notes, and snippets.

@mistyrinth
Created November 29, 2018 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mistyrinth/2b178194d4a8ca2cda569d8e9845eb18 to your computer and use it in GitHub Desktop.
Save mistyrinth/2b178194d4a8ca2cda569d8e9845eb18 to your computer and use it in GitHub Desktop.
array = ["醤油", "酢",["塩", "胡椒"], "ポン酢"]
puts "元の配列は #{array} です"
# 配列の平滑化
newarray = array.flatten
puts "置き換えた後の配列は #{newarray} です"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment