Creating a JS coding challenge

I want to create a challenge where a camper will write a JScode from scratch to check whether a year is leap year. code will vary for different users. How do I validate the output of campers on different testcases.

if the camper has to write a function, you can test if the function gives the correct output

What if the camper doesn’t have to write a Function?

Regex probably. If it’s a variable you can check the value.

Or if you can analize the code through an Abstract Syntax Tree that could work

1 Like