Не понимаю, почему в результате указывает 'undefined'
"functions.js"
import { checkAccess, grantAccess, denyAccess } from './helper.js';
export const auth = (user, password) => {
if (checkAccess(user, password)) grantAccess(user.name)
else denyAccess(user.name)
}
"helper.js"
export const checkAccess = (user, password) => {
if (user.password === password && user.role === 'admin')
return true
else return false
}
export const grantAccess = (name) => {
console.log(Congratulations, ${name}. Access granted.
)
}
export const denyAccess = (name) => {
console.log(Sorry, ${name}. Access denied.
)
}