
JavaScript学习笔记
Zack_ZXY
Learning to code is rarely as easy as people make it out to be but it's also rarely as difficult as it seems in the depths of your despair.
展开
-
JavaScript原始类型学习笔记
附上学习地址: http://www.w3school.com.cn/js/pro_js_primitivetypes.asp js中,原始类型,一定要记住是原始类型,原始类型是5种。原始类型是5种,分别是:Undefined、Null、Boolean、Number、String也就是:未定义、空、布尔值、数字、字符串 Undefined: 一个变量声明但...原创 2019-01-17 17:54:25 · 202 阅读 · 0 评论 -
TypeScript学习笔记四 理解类的代码
官网教程:https://www.tslang.cn/docs/handbook/classes.html 理解类的代码: class Animal{ name:string private fierce:number constructor(animal:string,fierce=0){ this.name = animal ...原创 2019-01-23 18:48:19 · 228 阅读 · 1 评论 -
TypeScript学习笔记五 理解类的代码 public、private、protected、static及存取器
官网地址:https://www.tslang.cn/docs/handbook/classes.htmlpublic 公共的private 私有的protected 受保护的 class Animal{ public size:string = "small" protected name:string private fierce:number...原创 2019-01-24 12:36:01 · 9639 阅读 · 2 评论 -
TypeScript学习笔记一 基础类型
TypeScript:不介绍了,可以认为是一门基于JavaScript的编程语言。(ts会被编译成js文件)环境配置:1、安装最新的node2、打开命令行窗口,运行以下语句:npm install -g typescript 新建一个.ts文件在命令行窗口运行:tsc 文件名.ts这个ts文件就会在同级目录下生成一个同名的.js文件。 学习笔记一:...原创 2019-01-22 15:03:10 · 250 阅读 · 0 评论 -
TypeScript学习笔记二 接口
学习教程:https://www.w3cschool.cn/typescript/typescript-interfaces.html比如我写一段程序,打印出名字function printPerson(person:{name:string}){ console.log(person.name)}let xiaozhang = {name: "张三",age:18,fro...原创 2019-01-22 17:16:41 · 247 阅读 · 0 评论 -
TypeScript学习笔记三 接口 可索引的类型
官方教程:https://www.tslang.cn/docs/handbook/interfaces.html 用来描述可以通过索引得到值的类型。interface StringArray { [index: number]: string;}let myArray: StringArray;myArray = ["Bob", "Fred"];let myStr: ...原创 2019-01-23 12:56:19 · 2012 阅读 · 0 评论 -
TypeScript学习笔记四 接口 类类型
接口除了可以描述变量,描述函数,还可以描述类interface Animals{ name: string size: string setName(animalName:string) setSize(animalSize: string) getName():string}class Mammal implements Animals{ ...原创 2019-01-23 16:59:21 · 193 阅读 · 0 评论