mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 23:34:21 +00:00
13 lines
317 B
TypeScript
13 lines
317 B
TypeScript
|
export function arrayExtension<T>(array: Array<T>, index: number, newValue: T): Array<T> {
|
||
|
const clone = [...array]
|
||
|
clone[index] = newValue
|
||
|
return clone
|
||
|
}
|
||
|
|
||
|
|
||
|
export function arrayExclude<T>(array: Array<T>, index: number): Array<T> {
|
||
|
const clone = [...array]
|
||
|
delete clone[index]
|
||
|
return clone
|
||
|
}
|