Rename variables used in map method

This commit is contained in:
Alexander Schranz
2022-01-14 12:19:38 +01:00
committed by Fabien Potencier
parent e8068a9a6d
commit b74cf2ae6c
+1 -1
View File
@@ -27,7 +27,7 @@ The arrow function also receives the key as a second argument:
"Alice": "Dupond",
} %}
{{ people|map((last, first) => "#{first} #{last}")|join(', ') }}
{{ people|map((value, key) => "#{value} #{key}")|join(', ') }}
{# outputs Bob Smith, Alice Dupond #}
Note that the arrow function has access to the current context.