You have an array of digits:
const digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
In the code below an element is given to the check() function. Change it so that the function checks if the element exists in the array and returns true or false.
You have an array of digits:
const digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
In the code below an element is given to the check() function. Change it so that the function checks if the element exists in the array and returns true or false.
Sample Input 1:
5Sample Output 1:
trueCreate a free account to access the full topic