google.com, pub-2782336357453463, DIRECT, f08c47fec0942fa0

I understand that ignorance of the law is no defense. However, a friend of mine passed a bad check and he got off because he didn’t know it. How come?

You are confusing two separate issues. The fact that you do not know an act is a crime defined by statute in your state is no defense if you are charged. On the other hand to be charged with passing a bad check, you must know that there is not enough money in your account to cover the check when presented to the bank. Knowledge that the check is not good when you write it is an “element” of the defense. The state has to prove that you wrote the check with knowledge that it wasn’t good. If your friend wrote the check believing that there was enough money in his account to cover it when presented, he hasn’t committed a crime because one of the elements of the crime is missing.