UNPKG
duckengine
Version:
latest (2.1.0)
2.1.0
2.0.1
2.0.0
1.2.1
1.2.0
1.1.2-beta
1.1.1-beta
1.1.0
1.1.0-beta
1.0.1
1.0.1-beta
1.0.0
1.0.0-beta
A 2D Game Engine for the web.
github.com/ksplatdev/DuckEngine
ksplatdev/DuckEngine
duckengine
/
src
/
utils
/
swapElement.ts
9 lines
(8 loc)
•
177 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
export
default
function
swapElement
<
t
=
unknown
>(
array
: t[], index1: number, index2: number
)
{
array
[index1] =
array
.
splice
(index2,
1
,
array
[index1])[
0
];
return
array
; }