1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuri [45]
3 years ago
14

Days of the week are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Write a javaScript f

unction solution that, given a string S representing the day of the week and an integer K (between 0 and 500), returns the day of the week that is K days later. For example, given S = "Wed" and K = 2, the function should return "Fri". Given S = "Sat" and K = 23, the function should return "Mon".
Computers and Technology
1 answer:
dmitriy555 [2]3 years ago
3 0

Answer:

function getDay(s, k){

var weekDays = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];

var index=weekDays.findIndex(function(weekDay){return weekDay==s;});

return weekDays[(index+k)%7];

}

Explanation:

//this functions receive the next parameters:

//s which is the day of the week

//k the number of days after s week day

function getDay(s, k){

var weekDays = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];

//variable index is the index in list weekDays of s

var index=weekDays.findIndex(function(weekDay){return weekDay==s;});

//use module operator % to get the remainder of the division (index+k)/7

//return the string value of the day

return weekDays[(index+k)%7];

}

You might be interested in
____, a Symantec product, offers a number of residential firewall and security applications that also provide various degrees of
Alexeev081 [22]

Answer:

Norton

Explanation:

<h2><u>Fill in the blanks </u></h2>

<u>Norton</u> , a Symantec product, offers a number of residential firewall and security applications that also provide various degrees of content filtering and proxy services.

4 0
3 years ago
Compare and contrast the various write strategy used in cache technologies<br>​
scZoUnD [109]

Answer:

The abiotic factors are non-living factors in an ecosystem that affect the organisms and their lifestyle. In this case, low temperature and low humidity lead to the conditions that are unfavorable for birds. So, the birds must adapt to these factors by hiding the food in the caches.

Explanation:

8 0
3 years ago
Human services organizations seek to make changes and help people in need to improve their .
bixtya [17]

Answer:

quality of life

Explanation:

7 0
3 years ago
What are the other way of getting website static​
erica [24]

Answer:

Explanation: Jekyll. Jekyll is far and away the most popular static site generator. ...

Hexo. Hexo is a build tool created with nodeJS, which allows for super speedy rendering, even with extremely large sites

and Hugo

I hope this help =D

7 0
3 years ago
Read 2 more answers
Summarize how the components of health are related to wellness ​
Valentin [98]
Physical wellness indicates a high level of endurance, flexibility and strength... Mental and emotional wellness focuses on an acceptance and agreement with ones emotions and feelings.
9 0
4 years ago
Other questions:
  • Write a java program called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the numbe
    6·1 answer
  • Which ie tab is used to configure how to manage cookies?
    13·1 answer
  • What are the four elements of game design?<br><br> Help Me!!
    9·1 answer
  • All states that have altered judicial selection techniques in recent years have adopted some form of:
    5·1 answer
  • Mia uses the formula pi times r to the power of 2 to find the area of a circle. What is pi times r to the power of 2 an example
    9·2 answers
  • If your computer won't connect to the internet, which of these is most likely to be the problem?
    8·1 answer
  • How do you code a website?
    10·1 answer
  • . What process skill would a scientist use to find the length of a line
    5·1 answer
  • How is hybrid computer used in hospitals? please reply fast!!​
    14·1 answer
  • If you are going to build a custom fast PC for gaming and you need a lot of storage for big video files and videos, but you have
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!