Blogger Information
Blog 28
fans 0
comment 0
visits 15777
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0708作业 赋值和字面量简化 函数
︷肉園耔︷
Original
505 people have browsed it
  • — 代码区
    ```
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    </head>
    <body>
    <script>
    /* let x=10;

    1. let y=x;
    2. console.log(x,y);
    3. console.log("x= %d,y=%d" ,x,y);
    4. x=20;
    5. console.log("x=%d,y=%d",x,y);
    6. //2.引用传递
    7. let obj1={
    8. x:10,
    9. y:20,
    10. };
    11. console.log("obj1= %o" ,obj1);
    12. console.table(obj1);
    13. let obj2=obj1;

    console.table(obj2);

    obj1.x=”javascript”;
    console.table(obj1);
    console.table(obj2);

    const f1=x =>(x=10);
    console.log(f1(5));

    1. let username="admin";
    2. let str = `HEllo
    3. ${username}`;
    4. console.log(str);

    let nav=[“首页”,”教学视频”,”文章”];
    let html=`
    <nav>

    1. <a href=""><${nav[0]}></a>
    2. <a href=""><${nav[1]}></a>
    3. <a href=""><${nav[2]}></a>
    4. </nav>

    `
    console.log(html);
    document.body.insertAdjacentHTML(‘beforeend’,html);

  1. let [a,b,c="100"]=[10,29];

console.log(a,b,c);

  1. [a,b,c,...d]=[10,20,30,40,50,60];
  2. console.log(a,b,c,d);
  3. console.log(...d);
  4. let a=10,
  5. b=20,
  6. console.log('a=%d,b=%d'); */
  7. let z=10,
  8. q=20;
  9. console.log(z,q);
  10. [z,q]=[q,z];
  11. console.log(z,q);

//数组传惨
let sum =([a,b]) => a+b;
console.log(sum([10,20]));

  1. /* let sum=([a,b])=> a + b;
  2. console.log(sum(10,20)); */
  3. let lecture={
  4. name:'朱老师',
  5. email:'4986464@qq.com',
  6. getInfo:function(){
  7. return `${this.name}:(${this.email}) `;
  8. }
  9. }
  10. console.log(lecture);
  11. let {name,email} =lecture;
  12. console.log(name,email);
  13. user ={
  14. name,email,
  15. getInfo:()=>'${this.name}:{${this.email}}',
  16. }
  17. console.log(user);
  18. </script>

</body>
</html>
```

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post