1
1

More than 3 years have passed since last update.

小技:文字列の文字をランダムに並び替える

Last updated at Posted at 2021-08-08

非実用的でとてもどうでもいい小技

'文字列'.split('').sort(() => .5 - Math.random() ).join('')

example

> 'L知っているか、死神はリンゴしか食べない'.split('').sort(() => .5 - Math.random() ).join('')
"べてっ知死るゴ食、いLリなかし神はいかン"

なんとなくイヌカレー空間ぽい

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1