screen_rotation
Copied to Clipboard
<html> <head> <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"> </head> <body> <div id="app" class="container"> <h1>Vue js every() function</h1> <p>When all items in an array pass a test, the every() function returns true .</p> <p>check salary : {{salaryies}}</p> <button class="btn btn-primary" @click="myFunction">Check Salary</button> <p></p> <p>{{results}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return { salaryies :['10000','15000','20000'], results:'' } }, methods:{ myFunction(){ this.results = this.salaryies.every(this.checkSalary); }, checkSalary(salary){ return salary > 9000; } } }).mount('#app') </script> </body> </html>