会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
#Friday
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
7
8
9
10
11
12
下一页
2021年2月16日
CSS的压缩
摘要: 压缩的内容: 删除注释、空格和换行; 删除多余的分号; 删除空的CSS样式 压缩的工具: 第一种:命令行工具-YUI Compressor: 1.安装jdk环境,jdk下载地址:https://www.oracle.com/java/technologies/javase-jdk15-downloa
阅读全文
posted @ 2021-02-16 18:31 #Friday
阅读(222)
评论(0)
推荐(0)
2021年2月10日
ES6-Class的写法
摘要: 1.Class的用法 class Person{ constructor(name, age){ this.name = name; this.age = age; } say(words){ console.log(`${this.name} is saying ${words}.`); } }
阅读全文
posted @ 2021-02-10 11:12 #Friday
阅读(124)
评论(0)
推荐(0)
2021年1月24日
对象的扩展-Object.assign()
摘要: 1.只会拷贝本身的属性,不会拷贝prototype上的属性 2.如果有同名的属性,后面的会覆盖前面的 3.target如果不是对象,是string,number或者boolean,会先转化为包装类 4.如果target是undefined,null,无法转化为包装类,那么报错 5.如果source不
阅读全文
posted @ 2021-01-24 14:59 #Friday
阅读(109)
评论(0)
推荐(0)
2021年1月21日
函数的参数默认值-this绑定
摘要: let obj = { a: 25 }; function f(a, b){ console.log(this.a , a, b); } f.call(obj, 1, 2); f.apply(obj, [1, 2]); f.bind(obj)(1, 2); 运行结果
阅读全文
posted @ 2021-01-21 22:38 #Friday
阅读(94)
评论(0)
推荐(0)
2021年1月17日
箭头函数
摘要: // 1.有且只有一个参数,且只有一句返回 let f2 = a => a + 1; console.log(f2(5)); 返回结果 // 2.没有参数,且只有一句返回 let f2 = () => 25; console.log(f2()); 返回结果 // 3.多于一个参数,且只有一句返回 l
阅读全文
posted @ 2021-01-17 20:02 #Friday
阅读(138)
评论(0)
推荐(0)
模板字符串
摘要: 字符串模板:支持多行,无需换行;支持使用变量;支持任何的函数表达式 let [a, b, c] = [1, 2, 3]; function f(){ return 15; } let s = `<ul> <li>${f()}</li> <li>${a+b}</li> <li>${c}</li> </
阅读全文
posted @ 2021-01-17 16:05 #Friday
阅读(133)
评论(0)
推荐(0)
2021年1月11日
ES6--let关键字
摘要: 1.let关键字声明的变量,只在块中有效 if(true){ var a = 5; let b = 5; } console.log(a); console.log(b); 分割线 运行结果: 2.let关键字可以防止循环变量的泄露,同时能够提供闭包 for(let i = 0; i < 5; i+
阅读全文
posted @ 2021-01-11 22:27 #Friday
阅读(139)
评论(0)
推荐(0)
2021年1月10日
ES6运行的三种方式
摘要: 第一种:浏览器直接显示(Babel浏览器脚本) <head> <script src="https://cdn.bootcdn.net/ajax/libs/babel-standalone/6.26.0/babel.js" type="text/javascript"></script> <!--
阅读全文
posted @ 2021-01-10 18:14 #Friday
阅读(1834)
评论(0)
推荐(0)
2021年1月7日
ES6和ES5中script标签写法不同
摘要: ES6中写法: <body> <script type="text/babel"> ... </script> </body> 分割线 如果浏览器天然支持ES6的话,也可以写成如下: <body> <script type="module"> ... </script> </body> 分割线 ES
阅读全文
posted @ 2021-01-07 21:45 #Friday
阅读(334)
评论(0)
推荐(0)
2021年1月6日
babel下载
摘要: 网址: https://www.bootcdn.cn/babel-standalone/ 找到对应版本,点击【复制<script>标签】或者【复制链接】即可:
阅读全文
posted @ 2021-01-06 23:34 #Friday
阅读(472)
评论(0)
推荐(0)
上一页
1
···
7
8
9
10
11
12
下一页
公告