Nitpick: in JS, `array.foo` and `array['foo']` are identical, and so it's considered good practice to use the dotted syntax when accessing the same name all the time, and the bracketed syntax when using variables to access different names. In this case, I'd suggest `badgeclass.is_earned`.