Trevor Noah and Jim Carrey. Picture: Trevor Noah/Instagram

Jim Carrey helped Trevor Noah come to terms with his depression.

The 'Daily Show' host revealed that he never even knew he suffered from the mental illness until he heard his comedic hero discussing his own struggles and it helped him to understand his conflicted feelings.

Speaking at the Just For Laughs comedy festival in Montreal, he said: "You can't win at comedy. Every comedian knows, you're going to have your good days, you're going to have your bad days, but you don't win. Winning is getting to the end without committing suicide, and Jim Carrey was one of the first comedians that described the beast that many of us face in this room and that's depression.

"I didn't know what that thing was. I just thought I liked sleeping for weeks on end sometimes, and then I read [Carrey's] story and I was like, 'Oh s**t, that's what's going on,' and I thank you because, you know, I found a way to fight it. I found a way to build a community and that's what this place is, it's a community of people trying to do something."

Trevor, 33, has previously spoken about how comedy helps him deal with his depression.

He said: "You know what's funny about [depression], though, is people go, 'If you're depressed, you can't smile, if you're depressed you can't tell jokes,' but as comedians that's like the one thing most comedians share is that monkey on the back of depression."

And Jim has discussed his mental illness in the past, explaining that he came off his Prozac medication because it left him with a "low level of despair".

He said: "I was on Prozac for a long time. I had to get off at a certain point, because I realised, you know, that everything's okay. It feels like a low level of despair you live in, where you're not getting any answers, but you're living okay and you can smile at the office, but it's a low level of despair."