I've seen ArcGIS Online's "Attach Code" tool for Web Map Applications mentioned in passing in several help documents but always in passing and, at present, I can't seem to find any definitive documentation on what is does. Is there any documentation online explaining clearly what "Attach Code" does.
It's funny that there isn't much listed in terms of documentation for the "attach code" button.
Take a look at this:
Towards the bottom it says:
You can attach code (as a ZIP file) with your apps. This can be helpful if you are sharing a sample or a configurable app and want others to have access to your code. Click Attach Code and browse to the location of your code (as a ZIP file). To update a code attachment without resetting the download counter on the item, use Update Code and upload a ZIP file with the same name as the original ZIP file. If you want to attach a new file, first delete the existing file; then use Attach Code. This will reset the download count on the item.