NBC's Brooklyn Nine-Nine is considered one of the funniest workplace comedies on television. Created by Dan Goor and Michael Schur (who is famous for other fantastic workplace comedies like The Office and Parks and Recreation), the show is well known for its lovable characters, hilarious writing, and great jokes.

RELATED: Andy Samberg: 5 Of His Best Movie Roles (& 5 Of His Worst), According to IMDB

Andy Samberg became one of the most popular actors after portraying Jake, the genius but childish detective in the 99th precinct. And while Jake is considered to be a great person, he has done some bad things to his friends. Here are 5 times Jake was a bad friend, and 5 times he was a great one.

Bad - Undermines Charles's Authority

Jake is one of the smartest detectives in the precinct and therefore is often the Primary detective in many cases. Due to his ego and personality, he hates taking a back seat and letting someone else be in charge. In the season 1 episode, "M.E. Time", Jake is assigned as Charles's Secondary.

Not only does he constantly undermine Charles but he also ends up sleeping with the medical examiner for the case, therefore endangering the whole case. This was all after Jake had promised to be a better secondary, so Jake really needs to be a better friend, especially since Charles is such a great partner.

Great - Gives Up His Childhood Dream Of Catching A Serial Killer To Get Holt Back At the Nine-Nine

After Captain Holt is removed from the Nine-Nine, The Vulture is made Captain. Holt and Jake take the case of the Oolong Slayer since it had always been a dream of Jake to catch a serial killer. Even after being ordered not to pursue the case, they follow the leads and capture the killer.

Jake, however, goes to the deputy commissioner and offers to give him full credit if Holt is reinstated as the Captain of the Nine-Nine. Holt returns, and when asked how this happened, he looked meaningfully at Jake and says, "I guess someone had my back." It was sweet to see their relationship had evolved so much beyond bickering about ties.

Bad - Gets Mad At Gina For Throwing Him A Lifeline

After Jake's grandmother's rent-controlled building goes co-op, he must scramble to find the money for the deposit if he is to continue living there. Gina, who is a childhood friend of Jake's, offers to buy the apartment and take the same rent, which he gets mad about since she has been saving her money and being "an adult".

RELATED: The 15 Best Episodes of Brooklyn Nine-Nine Of All Time

He asks when she became a grown-up and throws a childish tantrum, but ultimately realizes she was right. Gina buys and moves into Nana's apartment, and Jake moves into her starter apartment.

Great - Helped Rosa In Coming Out To Her Parents

In the season 5 episode, "Game Night", Rosa is planning to come out as bisexual to her parents, and she takes Jake along. He helps her be confident and supports her when it doesn't go that way. He also helps her to come up with what she should say in a hilarious but heartwarming speech.

Later, when her family isn't willing to have game nights with her, Jake takes the entire squad to her place to organize a game night of their own. Jake and Rosa have come a long way from not talking about each other's personal lives in "The Swedes" to sharing every aspect of their lives.

Bad - Complains About Nikolaj Ruining Everything

Brooklyn Nine-Nine Nikolaj

After Jake comes back from Florida, he desperately tries to recapture some of his old glory, but he sees that a lot of things have changed - the squad has been put on the night shift, everyone is depressed and tired, and Charles has adopted a son named Nikolaj ("Nikolaj" "That's what I just said!").

Charles prioritizes Nikolaj over the case, and Jake feels a little jealous and bitter, at one point even saying "Man, this kid of yours is ruining everything." Jake did spend months in Florida away from his normal life, but that's no excuse for behaving the way he did, almost like a spoiled kid whose toy has been taken away.

Great - Gets Gina The Job At the Nine-Nine

In the season 1 episode, "The Apartment", when Gina offers to buy his apartment and rent it to him, he gets bitter and complains to Amy about it. He asks when everyone became so grown up all of a sudden and tells her that he was the one who actually got Gina the assistant job at the Nine-Nine.

Gina and Jake have been friends since they were kids (just like Chelsea Peretti and Andy Samberg) and it's sweet to see Jake look out for her even when they're all grown up, even if he is mad at her, and says an ice cream cone could do her job.

Bad - Ignores Amy In The Third Halloween Heist

Brooklyn Nine Nine Halloween Heist

After Holt managed to emerge victorious in the Second Halloween Heist, Jake is determined to win the third edition. So determined, in fact, that he completely ignores Amy, saying that she would betray him for Holt.

RELATED: 10 Funniest Quotes From Brooklyn Nine-Nine

Although most of it is played for laughs, Jake not only refuses to let her take part in the Heist but when Amy tells him how she feels about him and Holt both excluding him, he laughs it off.

Great - Gets Nikolaj A Policeman Action Figure

Jake and Charles high five

When Boyle taps into his "inner mother" to get a Captain Latvia action figure for his son, he puts himself in risk after finding it in the hands of some Latvian mobsters. Jake asks him to go home and not put himself at risk, but he doesn't listen to him.

Jake knocks him out and saves him, but couldn't save the action figure from burning. So, he gets Charles a policeman action figure to give to Nikolaj, saying he was the hero his kid needs, and to not endanger his life like that next time. Nikolaj is happy to get a policeman's action figure, just like his daddy.

Bad - Disrespects Rosa's Authority As His Boss

Rosa and Jake look at each other

In "USPIS", Rosa, the head of the drug task force, orders Jake to cooperate and work with Jack Danger (pronounced Donger) a postal service federal agent, who turns out to be the most boring man alive (maybe after Teddy, Amy's ex). Although Jake hates him, he agrees to work with him because Rosa is his friend.

RELATED: 10 Lighthearted Shows Like Brooklyn 99

However, he takes classified information from Danger's laptop, who takes over the case, making Rosa mad. She tells Jake she ordered him to do it, as leader of the task force, and now the task force gets nothing.

Great - Encourages Terry To Write His Book

When DC Parlov, author of the Skyfire Circle, gets his manuscript stolen, he calls Jake and Terry. Terry has actually been writing a novel, and Jake suggests he show it to Parlov. Jake reads the novel and hates it, but when Parlov says it was amazing, he suspects Parlov was just trying to keep the Sarge happy, so he wouldn't suspect that Parlov himself stole the book for publicity.

Jake consoles Terry and tells him to keep working on his novel, and he would start to become better. He tells Terry how he is an amazing detective because he put the work in, and it would be the same way with the novel. Terry and Jake have one of the most wholesome relationships in the show.

NEXT: Brooklyn Nine-Nine: 5 Things That Changed After The Pilot (& 5 That Stayed The Same)