(onomatopoeia).

haha (with as many extra ‘ha’s as needed for emphasis)

French haha. French term attested 1686 in toponyms in New France (present Quebec); compare modern Saint-Louis-du-Ha! Ha!. Usual etymology is that an expression of surprise – “ha ha” or “ah! ah!” is exclaimed on encountering such a boundary. In France this is traditionally attributed to the reaction of Louis, Grand Dauphin to encountering such a feature in the gardens of the Château de Meudon. English term attested 1712, in translation by John James of French La theorie et la pratique du jardinage (1709) by Dezallier d'Argenville:

Grills of iron are very necessary ornaments in the lines of walks, to extend the view, and to show the country to advantage. At present we frequently make thoroughviews, called Ah, Ah, which are openings in the walls, without grills, to the very level of the walks, with a large and deep ditch at the foot of them, lined on both sides to sustain the earth, and prevent the getting over; which surprises the eye upon coming near it, and makes one laugh, Ha! Ha! from where it takes its name. This sort of opening is haha, on some occasions, to be preferred, for that it does not at all interrupt the prospect, as the bars of a grill do.