Javascript Random Array Element Restructuring Investment