mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +00:00
Fix map example output
This commit is contained in:
committed by
GitHub
parent
9984a6ee55
commit
97411730ab
+1
-1
@@ -27,7 +27,7 @@ The arrow function also receives the key as a second argument:
|
||||
"Alice": "Dupond",
|
||||
} %}
|
||||
|
||||
{{ people|map((value, key) => "#{value} #{key}")|join(', ') }}
|
||||
{{ people|map((value, key) => "#{key} #{value}")|join(', ') }}
|
||||
{# outputs Bob Smith, Alice Dupond #}
|
||||
|
||||
Note that the arrow function has access to the current context.
|
||||
|
||||
Reference in New Issue
Block a user