• 简写形式与变量解构


        let web={name:"houdunern",url:"xxx.com"}
        let {name,url}=web;
        console.log(name,url);    let web={name:"houdunern",url:"xxx.com"}
        let {name,url}=web;
        console.log(name,url);
        let arr=["houdunren","xxx.com"];
        // let [,b]=arr;
        let [a,b]=arr;
        console.log(a,b)
        let name="houdunren",url="xxx.com";
        let opt={name,url};//这个写法相当于let opt={name:name,url:url};
        console.log(opt);
        let hd={
            name:"houdunren",
            lesson:{
                title:"javascript"
            }
        };
    
        let {
            name,
            lesson:{title}
        }=hd;
        console.log(name,title);
        let arr=["houdunren","xxx.com"];
        let [a,b,c="hdcms"]=arr;
        console.log(a,b,c);
            let arr=["houdunren","xxx.com"];
        let [a,b,c="hdcms"]=arr;
        console.log(a,b,c);
        
        let arr={a:"houdunren",b:"xxx.com",c:"123"};
        let {a,b,c="hdcms"}=arr;
        console.log(a,b,c);
      function createElement(options={}){
            let {width=200,height=100,backgroundColor='red'}=options;
            console.log(width,height,backgroundColor);
          const div=  document.createElement('div'  );
          div.style.width=width+'px';
          div.style.height=height+'px';
          div.style.backgroundColor=backgroundColor;
          document.body.appendChild(div);
        }
        createElement({1000,backgroundColor:'green'});
  • 相关阅读:
    ue4 Windows RawInput Plugin
    UE4 VR中一种比较清晰的UI制作方式
    C# 自定义特性及反射
    C# 委托
    java+orace+hql分页
    数据库小知识总结
    往oracle数据库表中插入五十万条数据
    jsp页面传到action乱码问题
    常见数据库对象与java.sql.Types对照
    Oracle数据库初探
  • 原文地址:https://www.cnblogs.com/yyy1234/p/15831701.html
Copyright © 2020-2023  润新知