In this lesson https://v2.scrimba.com/learn-typescript-c0l/~0s the instructor uses a conditional on an enum to determine whether a star appears after the reviewer's name:
import { LoyaltyUser } from './enums'
export function showReviewTotal(value: number, reviewer: string, isLoyalty: LoyaltyUser) {
const iconDisplay = LoyaltyUser.GOLD_USER ? '⭐' : ''
reviewTotalDisplay.innerHTML = 'review total ' + value.toString() + '| last reviewed by ' + reviewer + ' ' + iconDisplay
}
logging the value inside the function to check e.g. console.log(LoyaltyUser.SILVER_USER ? LoyaltyUser.SILVER_USER : 'False') etc always logs the string and never evaluates to false regardless of what the user type is or which review the function is being run on.
If you change the display function params to another review such as Omar's or Andrzej's (silver and bronze users respectively), for example
showReviewTotal(reviews.length, reviews[1].name, reviews[1].loyaltyUser) then the star still shows up, even though it should only show for gold users.
Am I missing something here? I just started learning yesterday so that's entirely possible but I can't see how the conditional makes sense or is doing what it's supposed to. TIA