Skip to content

Commit 55316d0

Browse files
committed
rename variables for clarity
1 parent b186667 commit 55316d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chapters/arrays/removing-duplicate-elements-from-arrays.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ You want to remove duplicate elements from an array.
1111

1212
{% highlight coffeescript %}
1313
Array::unique = ->
14-
unique = {}
15-
unique[@[key]] = @[key] for key in [1...@length]
16-
value for key, value of unique
14+
output = {}
15+
output[@[key]] = @[key] for key in [1...@length]
16+
value for key, value of output
1717

1818
[1,1,2,2,2,3,4,5,6,6,6,"a","a","b","d","b","c"].unique()
1919
# => [ 1, 2, 3, 4, 5, 6, 'a', 'b', 'd', 'c' ]

0 commit comments

Comments
 (0)