-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
67 lines (61 loc) · 1.58 KB
/
Copy pathtest.js
File metadata and controls
67 lines (61 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// 测试babal是否生效
console.log("this.is.test.js.new test.?.")
// class Animal {
// constructor(name, color) {
// this.name = name
// this.color = color
// }
//
// toString() {
// console.log('name:' + this.name + ',color:' + this.color)
// }
// }
//
// const animal = new Animal('dog', 'white')
// animal.toString()
//
// module.exports = Animal
// async function test() {
// var b = 0;
// await setTimeout(() => {
// console.log("b");
// b = 100;
// }, 4000);
// console.log('asdf', b);
// return b;
// }
// test().then((data)=>{
// console.log("data", data);
// });
// const getJSON = async function(url) {
// const promise = new Promise(function(resolve, reject){
// const handler = function() {
// if (this.readyState !== 4) {
// return;
// }
// if (this.status === 200) {
// resolve(this.response);
// } else {
// reject(new Error(this.statusText));
// }
// };
// const client = new XMLHttpRequest();
// client.open("GET", url);
// client.onreadystatechange = handler;
// // client.responseType = "json";
// client.responseHeader = "image/png";
// // client.setRequestHeader("Accept", "application/json");
// client.send();
//
// });
//
// return promise;
// };
//
// getJSON("https://developer.mozilla.org/static/img/embed/promos/fx-dev-logo.bc0781dcd281.png").then(function(json) {
// console.log('Contents: ' + json);
// }, function(error) {
// console.error('出错了', error);
// });
// fetch('https://api.github.com/users/superman66')
async function