title: How to use ".find()" with an array in vuejs
body: <p>I have the following code on my project components:</p>
  
  <pre><code>&lt;template&gt;
    &lt;div&gt;
      &lt;agent
        v-for="agent in agents"
        :uuid="agent.uuid"
        :key="agent.uuid"
        :socket="socket"&gt;
      &lt;/agent&gt;
      &lt;p v-if="error"&gt;{{error}}&lt;/p&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;style&gt;
    body {
      font-family: Arial;
      background: #f8f8f8;
      margin: 0;
    }
  &lt;/style&gt;
  
  &lt;script&gt;
  const request = require('request-promise-native')
  const io = require('socket.io-client')
  const { serverHost } = require('../config')
  const socket = io()
  module.exports = {
    data () {
      return {
        agents: [],
        error: null,
        socket
      }
    },
    mounted () {
      this.initialize()
    },
    methods: {
      async initialize () {
        const options = {
          method: 'GET',
          url: `${serverHost}/agents`,
          json: true
        }
        let result
        try {
          result = await request(options)
        } catch (e) {
          this.error = e.error.error
          return
        }
        this.agents = result
        socket.on('agent/connected', payload =&gt; {
          const { uuid } = payload.agent
          const existing = this.agents.find(a =&gt; a.uuid === uuid)
          if (!existing) {
            this.agents.push(payload.agent)
          }
        })
      }
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>It seems everything is working fine, however, when I get an agent connected the following line is complaining...</p>
  
  <pre><code> const existing = this.agents.find(a =&gt; a.uuid === uuid)
  </code></pre>
  
  <p>message in the console sais 'Uncaught TypeError: n.agents.find is not a function'</p>
  
  <p>I don't see where is the bug... any help?
  Thanks a million</p>
  
  <p>UPDATE -> this is what I have in "result":</p>
  
  <pre><code>{…}
  agentMAC: (...)
  agentName: (...)
  connected: (...)
  createdAt: (...)
  id: (...)
  lastAccess: (...)
  loginDate: (...)
  pid: (...)
  updatedAt: (...)
  userId: (...)
  __ob__: Ae {value: {…}, dep: fe, vmCount: 0}
  get agentMAC: ƒ ()
  set agentMAC: ƒ (t)
  get agentName: ƒ ()
  set agentName: ƒ (t)
  get connected: ƒ ()
  set connected: ƒ (t)
  get createdAt: ƒ ()
  set createdAt: ƒ (t)
  get id: ƒ ()
  set id: ƒ (t)
  get lastAccess: ƒ ()
  set lastAccess: ƒ (t)
  get loginDate: ƒ ()
  set loginDate: ƒ (t)
  get pid: ƒ ()
  set pid: ƒ (t)
  get updatedAt: ƒ ()
  set updatedAt: ƒ (t)
  get userId: ƒ ()
  set userId: ƒ (t)
  __proto__: Object
  </code></pre>