02 2020 档案

摘要:严格模式下,匿名函数内部的 this 不再是 window,而是undefined "use strict"; (function(){ console.log(this); })(); 输出 undefined 使用 bind 方法修正 "use strict"; (function(){ con 阅读全文
posted @ 2020-02-28 20:27 内心澎湃的水晶侠 阅读(109) 评论(0) 推荐(0) 编辑
摘要:JS 中 方法里的变量声名提前 如下的一段代码,虽然在匿名方法中可以访问全局变量 global, 但由于声明被提前,所以输出依然是undefined var global = 3; (function(){ console.log(global); var global = 5; })(); 等价代 阅读全文
posted @ 2020-02-28 20:22 内心澎湃的水晶侠 阅读(124) 评论(0) 推荐(0) 编辑
摘要:经常用 GetType 获取一个Type 1. 想获取的 Type 在当前执行的 assembly 里面,则可以直接获取 Type myType1 = Type.GetType("System.Int32"); 2. 想获取的 Type 不在当前的assembly 里面,直接获取得到 null Ty 阅读全文
posted @ 2020-02-26 11:47 内心澎湃的水晶侠 阅读(780) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示