// Reverse array of characters, `xs`, mutatively. function reverse(xs: Array<string>) { let i: number = 0; let j: number = xs.length - 1; while (i < j) { let tmp = xs[i]; xs[i] = xs[j] xs[j] = tmp i += 1 j -= 1 } }
depot | ||
monorepo for the virus lounge | The Virus Lounge |
about summary refs log tree commit diff |
// Reverse array of characters, `xs`, mutatively. function reverse(xs: Array<string>) { let i: number = 0; let j: number = xs.length - 1; while (i < j) { let tmp = xs[i]; xs[i] = xs[j] xs[j] = tmp i += 1 j -= 1 } }