I am doing a javascript code editor online, and now I am doing line counting on the left side of the editor. I can’t understand how to do this, when a new line is created, it adds +1 to the line count, so each new line will contain the line number on the left. Does anyone know a good way to do this?
source
share