API Reference
@univerjs
@univerjs/core
functions
Rotate

@univerjs/core v0.1.17Docs


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

submodules/univer/packages/core/src/common/array.ts:60 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.