Essential JavaScript

Going Further

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

Click "Run Tests" to execute your function and see the test results below.

Test Results

Run your code to see test results

Console Output

// Console output will appear here...

0 output lines