comma before 'like' / 'such as' [preposition]: stethoscope, like a


1-It was a stethoscope, such as a doctor uses.
2-It was a stethoscope, like a doctor uses.

Is the comma correct in these sentences?
'Such as/like a doctor uses' is supposed to be non-restrictive. It does not define a specific sort of stethoscope, but just gives extra information about the word (the assumption being that only doctors use stethoscopes).
  • In this kind of situation, I fall back on the old rule of thumb: If it changes the meaning, no comma; if it does not change the meaning, but only gives additional information, then use a comma.

    So, if I want to say it is stethoscope and remind the reader that this is what doctors use, I would say: It is a stethoscope, like doctors use.

    But if I want to say it is a specific used by doctors, as opposed to stethoscopes used by nurses or safe crackers, I would not use the comma (but I would expect to explain more either before or after the sentence): It is a stethoscope like doctors use.