screen_rotation
Copied to Clipboard
<script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous"> <div id="app" class="container"> <h2>CopyWithin() function using Vue js</h2> <p>The copyWithin() in vue js techniques returns an array without modifying its length while copying a portion from it to another position even in the same array.</p> <p>The final two array elements should be copied to the first two array elements</p> <P>Number : {{number}}</P> <button @click='copywithin' class='btn btn-primary'>Copy Array</button> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ number : ['1','2','3','4','5','6'], } }, methods:{ copywithin(){ this.number.copyWithin(0,4,6); } } }).mount('#app') </script>