it-console/code/ts/后端辅助工具/src/main.ts

37 lines
438 B
TypeScript
Raw Normal View History

2023-02-09 10:36:43 +00:00
2023-02-10 10:38:33 +00:00
const greetings = "Hello, World!";
2023-02-09 10:36:43 +00:00
2023-02-10 10:38:33 +00:00
// console.log( greetings );
2023-02-09 10:36:43 +00:00
2023-02-10 10:38:33 +00:00
enum Season
{
2023-02-09 10:36:43 +00:00
spring = 1,
summer,
autumn,
winter,
};
2023-02-10 10:38:33 +00:00
const ar: string[] = [
"1", "2",
];
2023-02-09 10:36:43 +00:00
2023-02-10 10:38:33 +00:00
const ar2: (string | number)[] = [
1, 2, 3, "4",
];
const ar3: readonly (string | number)[] = [1, 2, 3, 4, 5, "7",];
const today = Season.spring;
function ts(): string
{
const message = "message";
return message;
}
ts();
console.log(today);
2023-02-09 10:36:43 +00:00