Taobin-Recipe-Manager/client/src/app/shared/helpers/tuple.ts
2024-01-17 17:38:23 +07:00

15 lines
288 B
TypeScript

export class Tuple<T, U> {
constructor(public first: T, public second: U) {}
public get(): [T, U] {
return [this.first, this.second];
}
public switchGet(elem: any): any{
if(elem == this.first){
return this.second;
} else {
return this.first;
}
}
}