12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- // 1.数组
- // let arr = [1,2,3,'55',true];
- // let [a,b,c,d,e] = arr;
- // console.log(a,b,c,d,e);
- // 2.对象
- // let obj = {
- // a1:1,
- // b2:"哈哈",
- // c3:function() {
- // console.log(this)
- // }
- // }
- // // console.log(obj.c())
- // let {a1,b2,c3} = obj;
- // console.log(a1,b2,c3)
- // 3.函数
- // function fn1() {
- // return {
- // name:"LiLi",
- // age: 10,
- // eat:function() {
- // console.log(this);
- // }
- // }
- // }
- // let {name,age,eat} = fn1();
- // console.log(name,age,eat);
- // 4.字符串
- let str = 'hello';
- let [q,w,r,t,y] = str;
- console.log(q,w,r,t,y)
- </script>
- </body>
- </html>
|