Helper Methods in Vue

You can make helper methods that will be used inside other methods. Such methods should also be accessed via this. Let's look at an example. Let's say we have the following method:

App.vueshow: function() {
  alert(this.text);
}

Let's create an auxiliary method that will capitalize the first letter of the passed string:

App.vuecape: function(str) {
  return str[0].toUpperCase() + str.slice(1);
}

Let's use a helper method inside the main method:

App.vuemethods: {
  show: function() {
    let text = this.cape(this.text);
    alert(text);
  },
  cape: function(str) {
    return str[0].toUpperCase() + str.slice(1);
  }
}
Задание 1

Create a helper method that will receive a number as a parameter and return the day of the week corresponding to this number.

Задание 2

Create a main method that will display the name of the current day of the week.