function categorizeMember(data) {
let resultArr = []
let userData = [data]
return userData.forEach(data => {
data.map(data => {
let category = (data[0] >= 55 && data[1] > 7) ? console.log("Senior") : console.log("Open");
return category
})
})
}
the function above should categorize members as senior or open in this form
[ 'Open', 'Senior', 'Open', 'Senior' ]
however, the output I received was:
Open
Senior
Open
Senior
an example of the expected output:
input = [[18, 20], [45, 2], [61, 12], [37, 6], [21, 21], [78, 9]]
output = ["Open", "Open", "Senior", "Open", "Open", "Senior"]