Answer:
</p><p>
</p><p>days1(); // calling function days1()
</p><p>
</p><p>function days1() // function days1
</p><p>
</p><p>{
</p><p>
</p><p>var week = ["sunday ", "monday ", "tuesday "," wednesday"," thursday",
</p><p>
</p><p>"friday"," saturday"];
</p><p>
</p><p>var i;
</p><p>
</p><p>for (i=0;i<7;i++) // iterating over the loop
</p><p>
</p><p>{
</p><p>
</p><p>document.write(" The number of days in a week :" +</br>);
</p><p>
</p><p>document.write( week[i] + "</br>" ); // print the number of days
</p><p>
</p><p>}
</p><p>
</p><p>}
</p><p>
</p><p>
Output:
The number of days in a week :
sunday
monday
tuesday
wednesday
thursday
friday
saturday
Explanation:
In this program, we create a function days1().In this function, we declared an array i.e " week " which will store the list of the days of the week. After that, we iterate the for loop and prints a list of the days of the week.
Hello RandomHacker
Using social media can inform you when events are happening near by.
For example: Your favorite singer of band is going on tour and they are doing it near you, social media advertises this and you can find out in time to go.
Hope this helps
-Chris
Answer:
Answered below
Explanation:
Recursion refers to the process of a function calling itself within its own definition. It calls itself repeatedly until a base condition is met and the loop breaks.
The advantages of recursion over loops include;
A) Recursion reduces time complexity.
B) Recursion is better at tree traversal and graphs.
C) Recursion reduces the time needed to write and debug code and also adds clarity to code.
Disadvantages of recursion include;
A) Recursion uses more memory because each function call remains in stack until the base case is met.
B) Recursion can be slow.
C) Recursion