As far a I know, you can't do anything inside the callback to force a result other than undefined whenever nothing is found, so you would need to use Short Circuit Evaluation to get something other than undefined
@godzilaravel be aware that this approach will work for the given example - but if your find test was different and an item is found within the array which is falsey (null, false, 0, ...) then it produce null as the result everytime. This is not the case for an isPrime test, but could be for an isEven test:
[0, 1, 2, 3].find((num) => num % 2 === 0) || null // result is null, not 0!