First of all, my apologies for any mistakes in my question as I have very less idea about asking questions.
I came up with these two cases :-
const comment = comments.find(function (comment) {
if (comment.id === 823423) {
return true;
}
});
And this:-
const comment = comments.find(function (comment) {
if (comment.id === 823423) {
return comment;
}
});
What’s the difference between the two as I tried to run both the code and it gave the same result and which one is a better practice?