This properly belongs under your comment above. Or you could ask a separate question and give this answer.
In the early records, yakkha as an appellative is, like nāga, anything but depreciative. Not only is Sakka so called (M. i, 252),
but the Buddha himself is so referred to, in poetic diction (M. i, 386).
We have seen Kakudha, son of the gods, so addressed (II, 2, § 8);
and in D. ii, 170 (Dialogues, ii, 200),
the city of the gods, Ālakamandā, is described as 'crowded with Yakkhas' ('gods'). They have a deva's supernormal powers, and are capable of putting very pertinent problems in metaphysic and ethics. But they were decadent divinities, degraded in the later era, when the stories to the Jātaka verses were set down, to the status of red-eyed cannibal ogres. Cf. the older and newer view together in Pss. of the Brethren, p. 245.
PED: Name of certain non-human beings, as spirits, ogres, dryads, ghosts, spooks. Their usual epithet and category of being is amanussa, i.e. not a human being (but not a sublime god either); a being half deified and of great power as regards influencing people (partly helping , partly hurting). They range in appearance immediately above the Petas (ghosts) ... They correspond to our "genii" or fairies of the fairy-tales and show all their qualities ... Historically they are remnants of an ancient demonology and of considerable folkloristic interest, and in them old animistic beliefs are incorporated and as they represent creatures of the wilds and forests, some of them based on ethnological features.)
The Arab singular (whence the French "génie"); fem. Jinniyah; the Div and Rakshah of old Guebre-land and the "Rakshasa,' or "Yaksha," of Hinduism. It would be interesting to trace the evident connection, by no means "accidental," of "Jinn" with the "Genius" who came to the Romans through the Asiatic Etruscans, and whose name I cannot derive from "gignomai" or "genitus." He was unknown to the Greeks, who has the Daimon, a family which separated, like the Jinn and the Genius, into two categories, the good (Agatho-dæmons) and the bad (Kako-dæmons). We know nothing concerning the status of the Jinn amongst the pre-Moslemitic or pagan Arabs: the Moslems made him a supernatural anthropoid being, created of subtile fire (Koran, chapts. xv. 27; lv.14), not of earth like man, propagating his kind, ruled by mighty kings, the last being Ján bin Ján, missionarised by Prophets and subject to death and Judgment. From the same root are "Junún" = madness (i.e., possession or obsession by the Jinn) and "Majnún" = madman. According to R. Jeremiah bin Eliazar in Psalm xli. 5, Adam was excommunicated for one hundred and thirty years, during which he begat children in his own image (Gen. v. 3) and these were Mazikeen or Shedeem - Jinns.
— The Book of the Thousand Nights and a Night, Volume 1, pg 10, translated by Richard F. Burton, Printed by The Burton Club for Private Subscribers only, 1885. Image from same source.
See also SN 1.10.1, n.1