保存进度!
This commit is contained in:
18
code/ts/后端辅助工具/src/DataType/DataType.ts
Normal file
18
code/ts/后端辅助工具/src/DataType/DataType.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-10 15:08:53
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-10 15:15:41
|
||||
* @FilePath: /后端辅助工具/src/DataType/DataType.ts
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*/
|
||||
/* eslint */
|
||||
|
||||
|
||||
//Tuple
|
||||
const tu: readonly [number, number, number] = [1, 1, 2,];
|
||||
|
||||
const toArray: [number, number, string] = [1, 2, "3",];
|
||||
const v1: (number | string)[] = toArray;
|
@@ -1,16 +1,36 @@
|
||||
|
||||
const greetings: string = "Hello, World!";
|
||||
const greetings = "Hello, World!";
|
||||
|
||||
console.log( greetings );
|
||||
// console.log( greetings );
|
||||
|
||||
enum Season {
|
||||
enum Season
|
||||
{
|
||||
spring = 1,
|
||||
summer,
|
||||
autumn,
|
||||
winter,
|
||||
};
|
||||
|
||||
let today: Season = Season.spring;
|
||||
const ar: string[] = [
|
||||
"1", "2",
|
||||
];
|
||||
|
||||
console.log( today );
|
||||
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);
|
||||
|
||||
|
Reference in New Issue
Block a user