JavaScript Function Movie Lab Age Conditional Statement
Can someone come up with a Javascript solution to this problem.... According to the description of R-rated films: Children under 17 require an accompanying parent or adult guardian (age 21 or older) and adults 25 years and under must show ID. And children under the age of 6 are not allowed in after 6:00pm. Deadpool is an R-rated movie. Write a JavaScript function named canIWatch that will take age as a parameter. If the age is less than 6, return You are not allowed to watch Deadpool after 6.00pm. If the age is 6 or more but less than 17, return You must be accompanied by a guardian who is 21 or older. If the age is 17 or more but less than 25, return You are allowed to watch Deadpool, right after you show some ID. If the age is 25 or greater, return Yay! You can watch Deadpool with no strings attached!. If the age is invalid, return Invalid age.