whqet
whqet
```javascript /* 继承 * */ //父类 var Person = function(name,age){ this.name = name; this.age = age; } Person.prototype.tall = 18; //子类 var Student = function(){}; Student.prototype = Person.prototype; Student.prototype.constructor =...
```javascript //es6 class Student{ constructor(name,age){ this.name = name; this.age = age; } sayHello(str){ console.log(this.name + str); } } var stu = new Student('whq',18); stu.sayHello(' hello'); ```
```html body{ background-color: #11113f; color: white; font-family: 'Petit Formal Script', cursive; overflow: hidden; } .title { position: absolute; text-align: center; top: 50%; left: 50%; -webkit-transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%,...
```html body { background-color: #11113f; color: white; font-family: 'Petit Formal Script', cursive; overflow: hidden; } .title { position: absolute; text-align: center; top: 50%; left: 50%; -webkit-transform: translate3d(-50%, -50%, 0); transform:...
```html body { background-color: #11113f; color: white; font-family: 'Petit Formal Script', cursive; overflow: hidden; } .title { position: absolute; text-align: center; top: 50%; left: 50%; -webkit-transform: translate3d(-50%, -50%, 0); transform:...
很好的活动,欢迎大家积极参与。 第二课堂积分已经日益重要,还等什么,实用技能、活动积分等你来拿!
```javascript //立即调用函数表达式 IIFE //可自动执行的匿名函数 //封装代码 (function(){ var i=1; console.log(i); })(); ```
```html ``` ```javascript var oBtnList=document.getElementsByTagName("input"); //错误 for (var i = 0; i < oBtnList.length; i++) { oBtnList[i].addEventListener("click",function(){ console.log("你单击了第"+i+"个按钮"); }) } //闭包 for (var i = 0; i < oBtnList.length; i++)...
```javascript /* 函数 0. 函数的功能 代码复用、模块化 事件处理 1. 函数的声明 function关键字 声明 作用域为全局 function 函数名(参数){ 函数体 } 函数表达式声明 作用域为声明语句之后 var 函数名=匿名函数声明 2. 参数 参数类型不定 实参如果少于形参,返回undefined 实参如果多于形参,多余的自动忽略 参数的默认值 不定参数个数的函数 arguments对象 length 属性...