Created
March 26, 2018 10:09
-
-
Save Krknv/15140fe495dce389f6e16ec8a1c9fa23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fastest way to move first element to the end of an Array | |
var array = [8,1,2,3,4,5,6,7]; | |
array.push(array.shift()); // results in [1, 2, 3, 4, 5, 6, 7, 8] | |
// https://stackoverflow.com/a/20385895/2618535 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment