标签:col view nbsp lan set 结构 user oct div
es6结构赋值:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>es6结构赋值</title> </head> <body> <script> //es6结构赋值 let arr=["held","word","good"]; let [firstname,twoname] = arr console.log(firstname,twoname); //held word let demo = ["a","b","c","d"]; let [name1, , name3] = demo; console.log(name1,name3);//a c //属性赋值 let user = {name:"张三",old:"18"}; [user.name,user.old] = [1,2] console.log(user);//{name: 1, old: 2} </script> </body> </html>
标签:col view nbsp lan set 结构 user oct div
原文地址:https://www.cnblogs.com/huanghuali/p/13019126.html