![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
夏至xz
望山山水水,人去去,隐隐迢迢
展开
-
es06模块化
user.jslet User = { username: "dongdong", age: 18, print() { console.log(`姓名${this.username},年龄${this.age}`); }};let girl = { realName: "wujin", cp: "dongdong"};//需要导入 要先导出//方式1.直接写在组件(变量、对象、函数...)上 eg: export let Us原创 2021-12-08 21:06:21 · 91 阅读 · 0 评论 -
es05异步编排、js中es6异步方法
<script> //es6 promise异步编排(异步嵌套) //eg:1.用户名是否存在--->2.手机号是否存在-->3.注册 new Promise((resolve, reject) => { $.ajax({ url: "", success: function (result) {原创 2021-12-08 20:43:28 · 152 阅读 · 0 评论 -
es04对象优化
<!-- <script> //创建一个常量对象 const person = { name: "你好", age: 12, info: "这是一个常量对象" }; console.log(Object.keys(person)); //["name","age","info"] console.log(Object.values(pers原创 2021-12-08 20:41:09 · 338 阅读 · 0 评论 -
es03函数优化
<script> window.onload = function () { function add(a) { if (!a) { //a=null或a=unfind... a = 1; } console.log(a);原创 2021-12-08 20:39:46 · 271 阅读 · 0 评论 -
es02解构和字符串
<script> window.onload = function() { //数组的解构(取出数组的过程) let arr = [1, 2, 3]; let a = arr[0]; let b = arr[1]; let c = arr[2]; alert(a + b + c); //es6 数组解构表达式原创 2021-12-08 20:38:22 · 105 阅读 · 0 评论 -
es01let和const
<script> window.onload = function() { var a = 1; alert("a=" + a); const b = 2; //常量 alert("b=" + b); // b = 3; //常量不可被修改 // alert(b);//Uncaught TypeError: Assignment to c原创 2021-12-08 20:37:11 · 161 阅读 · 0 评论