I am learning if-else statements with several conditions and this easy task is somehow bothering me since the else if in the external condition is being underlined in visual studio code. I cannot seem to fix it. It says 'Declaration or statement expected'. Can you guys please take a look and help me? This is my code.
function solve(input) {
let gender = (input.shift());
let age = Number(input.shift());
if (gender === 'Female') {
if (age >= 18) {
console.log('You are permitted on the website, lady.')
}
} else {
console.log('You are not permitted on the website, lady.')
}
} else if (gender === 'Male') {
if (age >= 18) {
console.log('You are permitted on the website, dude.')
} else {
console.log('You are not permitted on the website, dude.')
}
} else {
console.log('Error')
}
solve(['Female', '13'])