Yes, both are correct. #1 sounds like the speaker doesn't know what John did. #2 sounds like the speaker knows what John did.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
Yes, both are correct.
#1 sounds like the speaker doesn't know what John did.
#2 sounds like the speaker knows what John did.
Clive
I agree with Clive.
They are both are grammatically correct, but they have slightly different interpretations: "whatever" is non-referential, with a meaning like "anything that you did", whereas "what" is referential, with a meaning like "the thing that you did".