Pot.Struct.shuffle

{Array|Object|*} Pot.Struct.shuffle ({Array|Object|*} o)

Pot.js で利用可能。 PotLite.js では利用できません。

引数 o の要素をシャッフルして返します。

引数 o の要素の順番をシャッフルして、そのコピーを返します。

Pot.globalize() が適応されている場合、Pot.shuffle() が shuffle() で実行できます。

要素をシャッフルした o のコピーが返ります。

Pot.debug(Pot.shuffle([1, 2, 3, 4, 5, 6, 7, 8, 9]));
// e.g. (uncertain)
//   [8, 1, 6, 4, 3, 5, 2, 7, 9]

Pot.debug(Pot.shuffle(['foo', 'bar', 'baz']));
// e.g.
//   ['bar', 'foo', 'baz']

Pot.debug(Pot.shuffle(12345));
// e.g.
//   25143

Pot.debug(Pot.shuffle(-123456789.0839893));
// e.g.
//   -276195348.9908833

debug(Pot.shuffle({a: 1, b: 2, c: 3, d: 4, e: 5}));
// e.g.
//   {c: 3, b: 2, d: 4, e: 5, a: 1}

Pot.debug(Pot.shuffle('abcdef12345'));
// e.g.
//   'ae2d135cb4f'