Currently, I am deepening my understanding in javascript and exploring the vue.js 3 composition API. I have a specific question regarding retrieving the length of an array and displaying it within a <p> tag. The array in question is named "getForms".
<script>.....
const forms_length = computed(() => getForms.value.length)
<template>....
<p> {{form_length}} </p>
After implementing this code snippet, I encountered an error message: "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')"
Could you please explain why this error occurs and what steps should be taken to resolve it?
Your assistance on this matter would be greatly appreciated. Thank you!