you are referencing prop property itself instead of that one which has name stored in prop parameter
prop
try delete obj[prop]
delete obj[prop]