I have this function
const getMonthlyPriceFromData = (planName) => {
planTypeData.map((item) => {
if (item.name === planName) {
console.log(item.monthlyFee, 'fee')
return item.monthlyFee;
}
return null;
});
};
when I console.log(item.monthyFee) it returns the correct answer but when I call
console.log(getMonthlyPriceFromData('Free')) it returns undefined?