I think "list = list.slice()" is redundant。

Javascript is single-thread.So the multi-modification for the lists could't happen.