0

Suppose I have an existing array here

["abc", "def"]

I wanted to create an array with the existing elements inside that array:

[["abc"], ["def"]]
0

1 Answer 1

1

Let's put every element into an array

a.map { |item| [item] }
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.