本文介绍下js的OOP中的继承。 上图的要点为:Foo函数在创建时会自动生成内置属性prototype,而typeof Foo.prototype是object类型的。 上图的要点为:Foo.prototype内置两个属性,constructor和__proto__。 上图的要点为: 1.Stude ...
分类:
编程语言 时间:
2020-02-05 20:42:51
阅读次数:
89
typeof获取对象的的类型123456789typeof 123; // 'number'typeof NaN; // 'number'typeof 'str'; // 'string'typeof true; // 'boolean'typeof undefined; // 'undefined... ...
分类:
其他好文 时间:
2020-02-05 09:27:46
阅读次数:
57
将下边的代码复制粘贴进页脚中即可! 余姚申请js权限 (function(window,document,undefined){ var hearts = []; window.requestAnimationFrame = (function(){ return window.requestAni ...
分类:
其他好文 时间:
2020-02-03 16:13:52
阅读次数:
75
1.高级函数 1.1安全类型检测 typeof在Safari(第4版修复)老版中对正则表达式应用返回function,instanceof操作符存在多个全局作用域(像一个页面包含多个frame)会有问题,因此该两种检测类型都有一定局限 在任何值上调用Object原生的toString()方法,都会返 ...
分类:
其他好文 时间:
2020-02-03 00:01:34
阅读次数:
93
1.概述 Unity自带cube模型,但是此文实现,分基础版和完善版。基础版不进行顶点法线计算,完善版会进行法线计算,结果会跟自带cube比较接近。 2.基础版Cube 2.1 基类 using System.Collections; using System.Collections.Generic ...
分类:
其他好文 时间:
2020-02-02 21:37:34
阅读次数:
67
概述 本文在上一篇平面圆形基础上生成平面环形。 代码 基类 using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(MeshFilter),type ...
分类:
其他好文 时间:
2020-02-02 20:05:43
阅读次数:
147
1 代码方式 1 2 3 4 5 6 7 8 9 10 using(ServiceHost host=new ServiceHost(typeof(HelloWordService))) { host.AddServiceEndpoint(typeof(IHelloWordService), new ...
分类:
其他好文 时间:
2020-02-02 15:35:15
阅读次数:
56
1 class MySet { 2 constructor(params) { 3 if (typeof params[Symbol.iterator] !== 'function') { 4 throw new TypeError('Set的参数不是一个可以迭代的对象') 5 } 6 this._ ...
分类:
Web程序 时间:
2020-02-02 01:31:00
阅读次数:
99
1、ES6模块系统 1-1、export 导出 (1)、单独导出 // a.ts export let a = 1; (2)、批量导出 // a.ts let b = 2; let c = 3; export { b, c }; (3)、导出接口 // a.ts export interface I ...
分类:
Web程序 时间:
2020-02-02 00:51:38
阅读次数:
131
一:script 1.带有 src 属性的<script>元素不应该在其<script>和</script>标签之间再 包含额外的 JavaScript代码。如果包含了嵌入的代码,则只会下载并执行外部脚本文件,嵌入的代码 会被忽略。 2.defer 表示脚本延迟到文档完全被解析和显示后再执行,只对外 ...
分类:
Web程序 时间:
2020-02-01 19:50:57
阅读次数:
99