Solution: Input Validation

Let's see the solution to the input validation challenge.

Solution task-1

Here, we use the while loop to validate the input number less than or equal to 50. Otherwise, it continuously generates the number using Math.random() method.

Get hands-on with 1200+ tech skills courses.