Used mostly by old people, as (according to them) damn is too harsh a swear word to be uttered.
Used to show great frustration or annoyance or to reinforce/exclaim a point.
"Shut that dang refrigerator!"
"Hot diggity dang!"
"Oh dang. Everyone's going to know my identity now!"
"Dang it! I just stubbed my danged toe!"