Show Debug logs in return method

I have this code

int chck2nddblelist()
        int s2ndrandno = Random.Range(0, 3);
        Debug.Log("s2ndoublist2: " + s2ndrandno);
        return s2ndrandno

But everytime I call my code the debug doesn’t show. Is this a normal behaviour in return method if it is how to show the debugs.

It looks like you’re trying to return the function again, instead of returning s2ndrandno. This means the code will get stuck on that function for all eternity until it crashes.

You could try changing line 6 to show this:

return s2ndrandno;

You are missing semi-colon in return section

return s2ndrandno;

and you can try adding ToString() in Debug section

Debug.Log("s2ndoublist2 : " + s2ndrandno.ToString());