Skip to content
Advertisement

Getting first element of Observer Array

Hi dear friends, i cannot get first element or data etc. I did try notes[0] but the result was ‘undefined’. What kind of array is this? First time i’ve seen and i am using Vue.Js

Advertisement

Answer

You can access the first element simply using Array.from:

Array.from(notes)[0]

Also, {__ob__: Observer} is a special property added by Vue, it’s part of the Reactivity system which allows Vue to track data changes and react to them.

More info about Reactivity

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement