What are starred variables like *arr?
*arr = "sayuj"
=> ["sayuj"]
*arr = *%w{i am happy}
=> ["i", "am", "happy"]
*arr = %w{i am happy}
=> [["i", "am", "happy"]]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s called the splat operator, and it can collect elements into an array (applied to an un-bound variable) or split an array into individual elements (applied to an array).
That’s a little over-simplified, read the linked post for more in-depth information.