JavaScript scripts used on the Internet expose a number of risks. Allowing any arbitrary script, written by a possibly anonymous scriptwriter, to do something unknown to a trusting person's computer is a risk for that trusting person. On the other hand, to allow an anonymous person to obtain a script that is someone else's property presents a risk to the script writer.. There are numerous mechanisms available that can address these safety issues.
What your script does to your property is your own concern. It's when your property and scripts are mingled with other people's property and scripts that risks arise, and people are likely to become annoyed, upset or even litigious. Privacy matters set the boundaries of what shouldn't or can't be shared. Security matters set the boundaries of good behavior when there is a need to share. Security hobbles prevent scripts from crossing either kind of boundary without appropriate permission.