Skip to content

Commit 9984a6e

Browse files
committed
minor #3628 Rename variables used in map method (alexander-schranz)
This PR was submitted for the 3.x branch but it was merged into the 2.x branch instead. Discussion ---------- Rename variables used in map method As most people (including me) are lazy people to read text and mostly looks just at the code. Using `key` and `value` as variable make the map faster to understand which argument is which one :) Commits ------- b74cf2a Rename variables used in map method
2 parents e8068a9 + b74cf2a commit 9984a6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/filters/map.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The arrow function also receives the key as a second argument:
2727
"Alice": "Dupond",
2828
} %}
2929
30-
{{ people|map((last, first) => "#{first} #{last}")|join(', ') }}
30+
{{ people|map((value, key) => "#{value} #{key}")|join(', ') }}
3131
{# outputs Bob Smith, Alice Dupond #}
3232
3333
Note that the arrow function has access to the current context.

0 commit comments

Comments
 (0)