递归出题
This commit is contained in:
33
teaching/jwl/课件/es6/jiegoufuzhi.html
Normal file
33
teaching/jwl/课件/es6/jiegoufuzhi.html
Normal file
@@ -0,0 +1,33 @@
|
||||
<!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>
|
||||
<script>
|
||||
// let a=1;
|
||||
// let b=2;
|
||||
// let c=3
|
||||
|
||||
// let [a,b,c]=[1,2,3]
|
||||
|
||||
// 数组的解构
|
||||
// 数组是有序的 所以按索引值匹配
|
||||
// 匹配不到的话 变量值为undefined
|
||||
let [a,[b],[c]]=[1,[2],[4]]
|
||||
|
||||
|
||||
// 对象解构
|
||||
// 对象是无序的 变量必须与属性同名,才能取到正确的值。
|
||||
// 匹配不到的话 变量值为undefined
|
||||
// 对象在解构赋值的时候 先找同名属性,再赋值给对应的变量 真正被赋值的是后面的变量
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user