A website requires a page for adding users to the table Users. Users can be added in two ways:

  • By specifying their first name and last name with input elements, and then clicking on "Add user" button. After user is added, input elements should be cleared.
  • By executing the following JavaScript code: vm.users.push({firstName: "John", lastName: "Doe" })

After a user is added, it should be listed in the table Users, where the index column should start from 1.

For example, after executing vm.users.push({firstName: "John", lastName: "Doe" }) and adding Ann Franklin through UI, the tbody part of the Users table should be:

<tr>
  <td>1</td>
  <td>John</td>
  <td>Doe</td>
</tr>
<tr>
  <td>2</td>
  <td>Ann</td>
  <td>Franklin</td>
</tr>
HTML5, CSS3, Vue v2  
 

Run OK, but 4 out of 4 test cases fail:

  •   Example case: Exception
  •   Add users from UI: Wrong answer
  •   Add users from code: Exception
  •   Fields are cleared after adding users from UI: Wrong answer

Tags
Vue.js Directives Event handling Public New
Easy

15min

Score Distribution
Not enough data for chart
Would you like to see our other questions?

We have 500+ premium hand-crafted questions for 30+ job skills and 10+ coding language. We prefer questions with small samples of actual work over academic problems or brain teasers.

Visit our question library

Private Concierge

Send us an email with an explanation of your testing needs and a list of candidates. We will create an appropriate test, invite your candidates, review their results, and send you a detailed report.


Would you like to see our tests? The following tests contain Vue.js related questions:
On the TestDome Blog

Screening Applicants: The Good, the Bad and the Ugly

Since we’re all biased and we use incorrect proxies, why not just outsource hiring to experts or recruitment agencies? After all, they’ve been screening people for many years, so they must know how to do it right?

Not really. I was surprised to discover that many experts disagree with each other. Everybody praises their pet method and criticizes the others. Many of these methods look legitimate, but are based on...