3 ms·
Oops, I think the author meant to have copy[key] = val for the last line of this example: copyObject: (inputObject) -> copy = [] for key, val of inpu
by sanderjd 13y ago
Oops, I think the author meant to have copy[key] = val for the last line of this example:
copyObject: (inputObject) ->
copy = []
for key, val of inputObject
copy.key = val
As written, it uselessly sets a bunch of values to the key property in turn.
The point stands though.