Recursive Multiplication
Given an JavaScript object list of books that each have apagesattribute to define the number of pages in the book, find theproduct of all the pagesin the object list of books using recursion (you must use recursion to solve this problem).
Keep in mind:
function getPageCount(list) {// your code here// returns an integer}Example test case:Input:{"book":"A","pages":1,"next":{"book":"B","pages":2,"next":{"book":"C","pages":3,"next": null}}}Output: 6Reasoning: 1 * 2 * 3 pages
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here