ES5中编写函数,为了给参数默认值,必须在函数体内对参数判断,着实揪心。ES6好多了。
<script type="text/javascript">
function run(width = 100, height = 100)
{
console.log(width + '--' + height);
}
run(100);
</script> WebSql的原理是浏览器集成了sqllite数据库,Js操作,浏览器协助完成,没有多复杂。<!-- 三个核心方法  ...
<!DOCTYPE html> <html> <head> <title>捕捉和冒泡</title> <meta charset="utf-8"> </head> <bo...
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body>...
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <script type...
查看文章前你需要了解以下2点://1.this指向的是windows对象,通过console.log(this)可以查看到对象包含所有的方法和属性//2.全局变量属于this对象的属性通过console.log(this)可以查看到对象包含我们设置的全局变量我们经常在创建相同结构的Js对象会重复的设...
//字面量的形式创建原型对象 /* function Box(){} Box.prototype={ 'name':'gao', age:23, fun:function(){ return this.name+'--'+...