@univerjscorefunctionsRotate

@univerjs/core v0.5.0-beta.1Docs


Function: rotate()

function rotate<T>(arr, steps): readonly T[]

Rotate an array without mutating the original array.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
arrreadonly T[]the array to be rotated
stepsnumberhow many steps to rotate

Returns

readonly T[]

the rotated array, it is another array, the original array is not mutated.

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/array.ts:60