screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h2>Vue js Array lastIndexOf() Method function</h2> <p>Get last Index of India</p> <button @click="myFunction">Get last Index</button> <p></p> <p>Last Index: {{result}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ Array:['India','England','America','India','China','Russia'], result : '' } }, methods:{ myFunction(){ this.result = this.Array.lastIndexOf('India'); }, } }).mount('#app') </script> </body> </head> </html>