shuffle to javascript