A hinge with a damping function comprising a first fastening set (10, 110, 210) with a housing, a second fastening set (20, 120, 220) with a housing, as well as a damping unit (30, 130, 230) situated between the first fastening set (10, 110, 210) and the second fastening set (20, 120, 220), wherein the damping unit (30, 130, 230) comprises - a first damping set (31, 131, 231) comprising a first cam (13, 113, 213) non-rotatable in relation to the housing of the first fastening set (10, 110, 210) and shaped like a cylinder (11, 111, 211) open at a side of a middle of the hinge (1, 100, 200) and having a facing surface (14, 114, 214) with at least one protrusion (15, 115, 215) directed towards the middle of the hinge (1, 100, 200), - a second damping set (32,132,232) comprising a second cam (23,123, 223) non-rotatable in relation to the housing of the second fastening set (20, 120, 220) and shaped like a cylinder (21, 121, 221) open at the side of the middle of the hinge (1, 100, 200) and having a facing surface (24, 124, 224) faced towards the facing surface (14, 114, 214) of the first cam (13, 113, 213) and comprising at least one skid with an inclined slope, whereas the interiors of the first cylinder (11, 111, 211) and the second cylinder (21, 121, 221) form a central space or a central chamber, - a damping operator situated in the central space or the central chamber and having an actuating cylinder filled with a medium and closed at one end, and surrounded, at least partially, by a first cylindrical shell of the first cam (13, 113, 213) and a second cylindrical shell (26, 126, 226) of the second cam (23, 123, 223), and a piston (36, 136) with at least one pass-through opening and a piston rod (37, 137) slidably positioned in the actuating cylinder (35, 135), characterized in that the piston rod (37, 137) rests with its free end against a bottom of one of the first cylinder (11, 111, 211) or the second cylinder (21, 121, 221), in which the end of the actuating cylinder (35, 135) is not located and wherein the skid with the inclined slope has a difference of level between 2 mm and 30 mm that is equal to a difference between a quantity b in an open position of a window or door, distance as measured between an inner surface (19, 119, 219) of the housing of the first fastening set (10, 110, 210) and an outer surface of the housing of the second fastening set (20, 120, 220), and a quantity a in a closed position of the window or door or another closing element, distance as measured between the inner surface (19, 119, 229) of the housing of the first fastening set (10, 110, 210) and the outer surface (29, 129, 229) of the housing of the second fastening set (20, 120, 220). - a first damping set (31, 131, 231) comprising a first cam (13, 113, 213) non-rotatable in relation to the housing of the first fastening set (10, 110, 210) and shaped like a cylinder (11, 111, 211) open at a side of a middle of the hinge (1, 100, 200) and having a facing surface (14, 114, 214) with at least one protrusion (15, 115, 215) directed towards the middle of the hinge (1, 100, 200), - a second damping set (32,132,232) comprising a second cam (23,123, 223) non-rotatable in relation to the housing of the second fastening set (20, 120, 220) and shaped like a cylinder (21, 121, 221) open at the side of the middle of the hinge (1, 100, 200) and having a facing surface (24, 124, 224) faced towards the facing surface (14, 114, 214) of the first cam (13, 113, 213) and comprising at least one skid with an inclined slope, whereas the interiors of the first cylinder (11, 111, 211) and the second cylinder (21, 121, 221) form a central space or a central chamber, - a damping operator situated in the central space or the central chamber and having an actuating cylinder filled with a medium and closed at one end, and surrounded, at least partially, by a first cylindrical shell of the first cam (13, 113, 213) and a second cylindrical shell (26, 126, 226) of the second cam (23, 123, 223), and a piston (36, 136) with at least one pass-through opening and a piston rod (37, 137) slidably positioned in the actuating cylinder (35, 135), characterized in that the piston rod (37, 137) rests with its free end against a bottom of one of the first cylinder (11, 111, 211) or the second cylinder (21, 121, 221), in which the end of the actuating cylinder (35, 135) is not located and wherein the skid with the inclined slope has a difference of level between 2 mm and 30 mm that is equal to a difference between a quantity b in an open position of a window or door, distance as measured between an inner surface (19, 119, 219) of the housing of the first fastening set (10, 110, 210) and an outer surface of the housing of the second fastening set (20, 120, 220), and a quantity a in a closed position of the window or door or another closing element, distance as measured between the inner surface (19, 119, 229) of the housing of the first fastening set (10, 110, 210) and the outer surface (29, 129, 229) of the housing of the second fastening set (20, 120, 220).