%w(foo bar)
is another way to express ["foo", "bar"]
.
puts (%w(foo bar))
Output : [The foo, " bar]
It is used to create an array that stores the string, and instead of a comma, it is characterized by dividing the string based on the space and not using quotation marks.
© 2024 OneMinuteCode. All rights reserved.