keep an array, each time data is emitted from the socket add the items to the array. When it reaches length of 10 on each emit from the socket use unshift on the array with the new value and pop to remove the last, then, set innerHTML = '' (empty string)
and iterate on the array and add the items to innerHTML using +=
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…