I read from man page that they both used to set up text editor name. What is the difference between EDITOR & VISUAL shell variables on Linux? Can you please explain it?
They both define editor that must be used by default. The main differnce is that:
EDITORmust work without any advanced terminal functionality
VISUALis used by all modern apps and terminals. You need to set up VISUAL to a full-screen editor such as vi/vim, emacs, nano, and so on.