mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 15:24:21 +00:00
12 lines
317 B
TypeScript
12 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
|
|
}
|