Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

array-like/swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔀 @array-like/swap

ArrayLike value swapping for JavaScript. See docs.

import {swapRanges} from '@array-like/swap';
import {alloc} from '@array-like/alloc';
import {iota} from '@array-like/iota';

const n = 6;
const a = alloc(n);
iota(a, 0, n, 0);
const b = alloc(n);
iota(b, 0, n, 0);

swapRanges(a, 0, 3, b, 3);
a; // 3 4 5 3 4 5
b; // 0 1 2 0 1 2

License Version Tests Dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

About

🔀 ArrayLike value swapping for JavaScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.