Waiting is a reserved word

I have code that should receive data asynchrony:

  methods : {
    btn() {
      console.log("Hello");
      var url = "https://jsonplaceholder.typicode.com/users";
      let mydata = await fetch(url);
      console.log(mydata);
    }
  }

And I get the error: Module build failed: SyntaxError: D:/app3/src/App.vue: await is a reserved word (19:19)

+4
source share

Source: https://habr.com/ru/post/1670316/


All Articles