Do javascript to simulate pressing the keyboard enter or return key

How do I write a do JavaScript command that will simulate pressing the keyboard enter or return key to replace key coding with integer 13 using System Events, such as in the following script?

tell application "System Events"
	tell process "Safari"
		tell document 1
			key code 13
		end tell
	end tell
end tell

Why Do Javascript? If you’re doing in an Adobe App or Safari you can just activate the application first then insert your current code to make sure it is active. I found a similar code in an old library I use:


tell application "System Events"
	tell process "Adobe Acrobat" --- replace with whatever app
		keystroke return
	end tell
end tell