mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
18 lines
228 B
TypeScript
18 lines
228 B
TypeScript
let counter = 0;
|
|
|
|
export function getCount() {
|
|
return counter;
|
|
}
|
|
|
|
export function increment() {
|
|
return ++counter;
|
|
}
|
|
|
|
export function decrement() {
|
|
return --counter;
|
|
}
|
|
|
|
export function square(x: number) {
|
|
return x * x;
|
|
}
|