<!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>
var name = "Pning";
var professional = "JavaWeb开发";
var info = {
name,
professional,
go(){
console.log(info);
}
};
console.log("通过结构对象获取");
var {professional,...person} = info;//把剩余的属性封装到...修饰的对象中去
console.log(professional);
console.log(person);
</script>
</body>
</html>
01-07
699