Question: Write a function that determines whether or not someone can vote. The only argument is an object that represents the person. That object has a
Write a function that determines whether or not someone can vote. The only argument is an object that represents the person. That object has a property age that is a number which represents the person's age in years and a property isCitizen that is true if they are a citizen and false if they are not. The function should return true only if the person is a citizen and is years or older. Otherwise, it should return false. JavaScript
Examples:
canVoteage: isCitizen: true; returns true
canVoteage: isCitizen: true; returns false
canVoteisCitizen: false, age: ; returns false
canVoteage: isCitizen: false; returns false
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
