title: Print response from http GET request using axios in vue.js?
body: <p>When I access <a href="https://jsonplaceholder.typicode.com/todos?_limit=1" rel="nofollow noreferrer">https://jsonplaceholder.typicode.com/todos?_limit=1</a> in my browser I get:</p>
  
  <pre><code>[
    {
      "userId": 1,
      "id": 1,
      "title": "delectus aut autem",
      "completed": false
    }
  ]
  </code></pre>
  
  <p>I am now trying store the result (and print) of a simple http GET request in a variable using axios in vue.js with the above URL:</p>
  
  <pre><code>  const result = axios.get('https://jsonplaceholder.typicode.com/todos?_limit=1');
    console.log("result is = " + result)
    console.log("result.title is = " + result.title)
  </code></pre>
  
  <p>But the above gives the below output:</p>
  
  <pre><code>App.vue?234e:59 result is = [object Promise]
  App.vue?234e:60 result.title is = undefined
  </code></pre>
  
  <p>Is it not possible to print a json friendly result from a http get request (like with curl) without having to deal with <code>promises</code>in vue.js?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Based on below answers I have now tried the following in my <strong>App.vue</strong> file</p>
  
  <pre><code>&lt;script&gt;
  
  import axios from 'axios';
  
  export default {
    name: 'app',
    components: {
      AddTodo
    },
    data(){
      return {
        todos: []
      }
    },
  
    methods: {
      // not allowed to use function keyword here  
      async printJson(){
        let result = await axios.get('https://jsonplaceholder.typicode.com/todos?_limit=1');
        console.log("result is = " + result)
        console.log("result.title is = " + result.title)
      },    
  
      addTodo(newTodo) {
        this.printJson()  
      }
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>But that just gives:</p>
  
  <pre><code>App.vue?234e:50 result is = [object Object]
  App.vue?234e:51 result.title is = undefined
  </code></pre>