screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <h3>Vue js check if a variable is an array </h3> <div id="app"> <p v-if="Array.isArray(myArray)">myArray is an array!</p> <p v-else>myArray is not an array.</p> </div> <script type="module"> const app = Vue.createApp({ data() { return { myArray: [1, 2, 3], }; }, }); app.mount('#app'); </script> </body> </html>