摘要: var let const 1. for (var i = 0; i < 10; i++) { setTimeout( function() { console.log(i); } , 100 * i); } 执行结果为10 10 .... for (var i = 0; i < 10; i++) 阅读全文
posted @ 2021-11-22 09:57 云在青 阅读(26) 评论(0) 推荐(0) 编辑
摘要: // 类中主要是属性和方法 class Person { name: string ;(实例属性,通过对象访问) static age: number = 18;(静态属性,通过类进行访问) readonly sex: string = '男'; (只读属性,无法进行写操作) constructor 阅读全文
posted @ 2021-11-22 09:57 云在青 阅读(46) 评论(0) 推荐(0) 编辑