Jerks At Work

Toxic workers. We've all worked with them before. They spread rumors, they take credit for work they didn't do, and they get promoted while you quit your job. So what can we do about this without becoming jerks ourselves?