Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 2
    No competent programmer would ever make code more complicated than it needs to be. Commented Jul 2, 2012 at 1:32
  • 5
    It is necessary. The slice method is being used at the beginning of the function to backup the original array items before being modified by the function, this way the author has access to the positions, keys and values of the original array even after and while editing the array. This is indispensable when making a responsible string manipulating interface, as your example plugin. Complementing on @alex's comment, if it's there, there's a reason for it. Ctrl+F the source and look for where it's being accessed later on if you need a better understanding. Commented Jul 2, 2012 at 1:39