Ruby - Blocks, Procs, and Lambdas
You want to create an array of lambdas where each lambda returns the square of its index (0 to 4). Which code correctly achieves this using closures?
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions