LU05.A09 - v-if with logical operators

Prerequisites

Learning objectives

  1. Explaining the The directive v-if in your own word.
  2. Being able to apply logical operators within a v-if directive.

Source

Assignment

The first assignment checked by using v-if whether a certain variable was checked or not (true/false9Bei der ersten Aufgabe hat v-if binären Werte (true/false) geprüft. Now, we want to go one step further and check not only whether it is true or false, but moreover which value it contains. By this, we would be able to tell the customer of how many typewriters we have in stock, which may be of some benefit for the customer as well as for us.

  1. Change the value of the variable typewriter to 0 und execute the script.
  2. Note your realisations as a html-comment.
  3. Change the content of the variable typeWriter to -1.
  4. What happens, if the value typeWiter has no value at all respectively is empty?
  5. Note your realisations as a html-comment.
  6. Save your script acoordingly, whether in your W3School workspace or on you local computer in your code-editor Webstorm.

Solution

Lösung

Vocabulary

English German

Volkan Demir