Essential JavaScript

Age Verification Kata

You work for a grocery store chain where different products have different age requirements.

Only someone who meets the age requirement can buy the product.

When someone scans their ID, we can see their firstName, lastName, and age. Your function will receive a person object that has these properties.

You will also receive a product object with a name, price, and ageRequirement property.

Given a particular person and product, return true if the person can buy the product and false otherwise.

Code Editor