123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <!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 src="./src/ajax.js"></script>
- </head>
- <body>
- <script>
-
- async function fn(){
- return '111'
- }
- async function fn1(){
- throw new Error('f')
- }
- async function fn2(){
- return new Promise((resolve,reject)=>{
-
- reject('failed')
- })
- }
-
-
-
-
- const p = new Promise((resolve,reject)=>{
-
- reject('failed')
- })
- async function main(){
- try{
- let result = await p;
- console.log(result)
- }catch(e){
- console.log(e)
- }
- }
- main()
-
-
-
-
-
- sendAjax('https://api.apiopen.top/getJoke').then(value=>{
-
- })
-
- async function main1(){
- let result = await sendAjax('https://api.apiopen.top/getJoke')
-
- }
- main1();
-
- const school = {
- name : 'hihi',
- cities:['beijing','shanghai'],
- sub:['php','java']
- }
- console.log(Object.keys(school))
- console.log(Object.values(school))
- console.log(Object.entries(school))
- console.log(Object.getOwnPropertyDescriptors(school))
- </script>
- </body>
- </html>
|