Compare commits

..

2 Commits

3 changed files with 13 additions and 10 deletions

View File

@ -14,7 +14,8 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.dataTypes = void 0;
//Tuple
function dataTypes() {
function dataTypes()
{
const tu = [1, 1, 2,];
const toArray = [1, 2, "3",];
const v1 = toArray;
@ -22,18 +23,22 @@ function dataTypes() {
console.log(typeof s1);
let point;
point = { x: 0, y: 0, };
function addOne(x, y = 1) {
function addOne(x, y = 1)
{
return x + y;
}
console.log(addOne(1));
function allParams(x, y) {
function allParams(x, y)
{
const z = x + y;
}
//剩余参数,数组形式
function overplusArgusWithArray(x, ...argus) {
function overplusArgusWithArray(x, ...argus)
{
return argus.length;
}
function overplusArugsWithTuple(x, ...argus) {
function overplusArugsWithTuple(x, ...argus)
{
console.log(`元组形式的参数表${argus},剩余参数的数量${argus.length}`);
console.log(argus[2]);
return argus.length;

View File

@ -3,8 +3,8 @@
* @Author: Kane
* @Date: 2023-02-09 22:14:30
* @LastEditors: Kane
* @LastEditTime: 2023-02-12 23:52:33
* @FilePath: //src/main.ts
* @LastEditTime: 2023-02-13 09:31:28
* @FilePath: //target/main.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-09 15:24:20
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 00:21:52
* @LastEditTime: 2023-02-10 10:16:40
* @FilePath: //tsconfig.json
* @Description:
*
@ -13,8 +13,6 @@
"outDir": "./target",
"strict": false,
"strictNullChecks": true,
"target": "ES2015",
"module": "CommonJS",
},
// "files": [
// "./src/main.ts",