rubykoans.comで作業していると、about_array_assignment.rbでこれらの2つのコードに出くわしました。
1つ目が非並列割り当てであり、2つ目が1つの変数を使用した並列割り当てであることをどのように判断できますか?私には、名前の違いを除いて、コードはほとんど同じように見えます。
4 def test_non_parallel_assignment
5 names = ["John", "Smith"]
6 assert_equal ["John", "Smith"], names
7 end
45 def test_parallel_assignment_with_one_variable
46 first_name, = ["John", "Smith"]
47 assert_equal 'John', first_name
48 end