@pansy/array-move
    TypeScript icon, indicating that this package has built-in type declarations

    0.5.0 • Public • Published

    @pansy/array-move

    将数组项移动到其他位置

    📦 安装

    // npm
    npm install @pansy/array-move --save
    
    // yarn
    yarn add @pansy/array-move
    
    

    🔨 使用

    import arrayMove from '@pansy/array-move';
    
    const input = ['a', 'b', 'c'];
    
    arrayMove(input, 1, 2);
    // => ['a', 'c', 'b']
    
    arrayMove(input, -1, 0);
    // => ['c', 'a', 'b']
    
    arrayMove(input, -2, -3);
    // => ['b', 'a', 'c']
    

    Keywords

    none

    Install

    npm i @pansy/array-move

    DownloadsWeekly Downloads

    15

    Version

    0.5.0

    License

    MIT

    Unpacked Size

    4 kB

    Total Files

    7

    Last publish

    Collaborators

    • wangxingkang