当前位置:网站首页>Grain College p40~43

Grain College p40~43

2022-06-21 19:51:00 qq_ forty-six million one hundred and ninety-eight thousand nin

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script> let user={
      "name":"lucy","age":18} let name1=user.name let age1=user.age console.log(name1+"="+age1)//lucy=18 let {
      name,age}=user console.log(name+age)//lucy18 // Use  ` Line break  let str1=`hello eshhb ` console.log(str1)//hello //eshhb let Name="Mike" let Age=30 let str=`hello,${
        Name} age:${
        Age}` console.log(str)//hello,Mike age:30 function f1(){
       return "one" } let str3=`demo,${
        f1()}`//$+ The name of the function +() console.log(str3)//demo,one const ageone=23 const nameone="lucky" const p1={
      name:nameone,age:ageone} console.log(p1)//{name: 'lucky', age: 23} //age: 23 //name: "lucky" //[[Prototype]]: Object const p2={
      age,name} console.log(p2)//{age: 18, name: 'lucy'} //age: 18 //name: "lucy" //[[Prototype]]: Object const person1={
       sayHi:function(){
       console.log("Hi") } } person1.sayHi()//Hi // Object replication  let persontwo={
      "name":"jkl","age":16} let person3={
      ...persontwo} console.log(person3)//{name: 'jkl', age: 16} //age: 16 //name: "jkl" //[[Prototype]]: Object let name3={
      name111:'marry'} let age3={
      age111:20} let p3={
      ...name3,...age3} console.log(p3)//{name111: 'marry', age111: 20}age111: 20name111: "marry"[[Prototype]]: Object var f1=function(a){
       return a } console.log(f1(1))//1 var f3=a =>a console.log(f3(6))//6 </script>
		
		
	</body>
</html>

 Insert picture description here

原网站

版权声明
本文为[qq_ forty-six million one hundred and ninety-eight thousand nin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211810462245.html