Sugar also act as a preservative. It is used as a preservative in many food items. Basically, sugar absorb the excess amount of water from the food product and we know that the microorganisms generally grow in the moisture. There are many such items which contain sugar in them as a preservative. Actually, sugar act as a preservative by osmosis process.
Few examples of such preserved foods are jellies and jams.