2024-5-5 TS练习

// Welcome to the TypeScript Playground, this is a website
// which gives you a chance to write, share and learn TypeScript.

// You could think of it in three ways:
//
//  - A location to learn TypeScript where nothing can break
//  - A place to experiment with TypeScript syntax, and share the URLs with others
//  - A sandbox to experiment with different compiler features of TypeScript

const anExampleVariable = "Hello World"
const color = ['red','green','blue','yellow'];
console.log(anExampleVariable)
console.log(color)
//BigInt
//const unit = BigInt(1);
//展开数组字面量
const firstHalfYearSeasons = ['Spring', 'Summer'];
const seasons = [...firstHalfYearSeasons, 'Fall', 'Winter'];
console.log(seasons);

//展开对象字面量
const point2d = {
 x:0,
 y:0,
};

const point3d = {
    ...point2d,
    z:0,
}

console.log(point3d);

//展开函数参数
const nums = [3,1,4];
const max = Math.max(...nums);
console.log(max);

//解构-数组解构
const point = [0,1];
const [x, y] = point;
console.log(x);
console.log(y);

//对象解构
const point2 = {a:0, b:1};
const {a, b} = point2;
console.log("a:${a}, b:${b}");

//短路求值
let x4 = 0;
let a4 = undefined;
console.log(a4?.[++x4]);
console.log(x);

const greeting : string = 'hello, world';
const yes:boolean = true;
const no:boolean = false;

const foo:string = 'foo';
const bar:string = 'bar, ${foo}';
const bin:number = 0b1010;
const oct:number = 0o744;
const integer:number = 10;
const float:number = 3.14;
const hex:number = 0xffffff;
//BigInt literals are not available when targeting lower than ES2020
//const bin_int :bigint = 0b0101n;
const key :symbol = Symbol();
const symbolHasInstance : symbol = Symbol.hasInstance;
const s0:symbol = Symbol();
const s1:symbol = Symbol.for('foo');
const s2:symbol = Symbol.hasInstance;
const s3:symbol = s0;
const s01 : unique symbol = Symbol();
const s11 : unique symbol = Symbol.for('s1');
interface Foo{
  //  [s0]:string;
    [s01]:string;
}

const foo5:undefined = undefined;
const foo6:null = null;

function log(message : string):void{
    console.log(message);
}

enum Season{
    Spring = 1,
    Summer,
    Fall,
    Winter,
}
const fisrtSeason :Season = Season.Spring;
//const secondSeason :Season = 10;
const secondSeason: Season = 2;

enum Direction{
    Up = 'Up',
    Down = 'Down',
    Left = 'LEFT',
    Right = 'Right',

    U = Up,
    D = Down,
    L = Left,
    R = Right,
}

const direction:string  = Direction.Up;
//const direction2: Direction = 'Up';
//联合成员类型
const up:Direction.Up = Direction.Up;
//联合枚举类型
type UnionDirectionType = 
    | Direction.Up
    | Direction.Down
    | Direction.Left
    | Direction.Right;

enum Color {
    //Black = 0 + 10,居然没有报错
    //Black,居然也没有报错
    //怀疑是网页版本环境有部分功能缺失
    White = 'White',
}

enum Bool {
    False = 0,
    True = 1,
}
console.log(Bool.False);
console.log(Bool.True);

Bool[Bool.False];
Bool[Bool.True];

enum Bar{
    C = 'C',
    //编译错误
    //B,
}

// To learn more about the language, click above in "Examples" or "What's New".
// Otherwise, get started by removing these comments and the world is your playground.
  
  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: rf-phy.ts官网是一个专门提供关于RF-PHY技术的在线资源平台。RF-PHY技术是指射频物理层技术,用于无线通信系统中的信号传输和接收。该官网提供了丰富的技术资料、文献和教程,以帮助用户更好地了解和应用RF-PHY技术。 首先,rf-phy.ts官网提供了关于RF-PHY技术的详细介绍。用户可以通过浏览官网上的相关文章和文档,了解RF-PHY技术的原理和基本概念,以及其在无线通信系统中的应用和优势。 其次,官网还提供了许多实用的工具和资源,供用户进行学习和研究。比如,官网提供了RF-PHY技术的仿真软件和模型,可以帮助用户进行系统设计和性能验证。同时,官网还提供了一些示例代码和实验教材,供用户进行实际操作和练习。 此外,官网还设有在线论坛和社区,用户可以在这里与其他业界专家和爱好者进行技术交流和讨论。通过官网的论坛,用户可以分享自己的经验和问题,并得到解答和建议。 总的来说,rf-phy.ts官网是一个专业的在线资源平台,为用户提供了丰富的关于RF-PHY技术的资料和工具。通过官网,用户可以更深入地了解RF-PHY技术,并将其应用到实际的无线通信系统中。 ### 回答2: rf-phy.ts是一个官网,用于介绍和提供RF PHY(射频物理层)相关的知识和技术。在该官网上,我们可以了解到RF PHY的基本概念、原理和应用。RF PHY是无线通信中的重要组成部分,它涉及到射频信号的调制解调、信道编解码、信号处理和波形传输等核心技术。 通过rf-phy.ts官网,我们可以深入了解射频物理层的工作原理和算法。官网提供了关于射频信号的调制技术,如QPSK、16QAM等,以及信道编码技术,如Turbo码和LDPC码等。这些技术都是为了提高无线通信系统的传输速率和信号质量。 此外,rf-phy.ts官网还介绍了各种无线通信系统中射频物理层的应用,比如4G LTE、5G NR等。官网列举了这些无线通信系统的特点和性能指标,并且解释了射频物理层在其中的作用和优化方法。这对于学习无线通信系统的设计和优化非常有帮助。 总之,rf-phy.ts官网提供了丰富的关于射频物理层的知识和技术,对学习无线通信系统设计和优化以及相关领域的专业人员非常有价值。通过该官网,我们可以深入了解射频物理层的原理和应用,并且可以学习到一些优化射频物理层性能的方法和技巧。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值