Check out example codes for "can't add an editor script". It will help you in understanding the concepts better.

Code Example 1

Unity has several reserved folder names, "Editor" is one of them
Remove the script from the "Editor" folder and you should be able
to attach it to a game object

Learn ReactJs, React Native from akashmittal.com