No, Javascript is no protection whatsoever.
A junk mailer will find a mailform (or other web form) and simply submit POST requests to the PHP script directly. The page that contains the form HTML and the Javascript won't even need to be requested each time, let alone be 'executed'.
The only way to make form submissions safe is to use your PHP code to very carefully screen every piece of data that has come from an external source, whether that external source is your own web form, a remote web page, or a remote file.
I got caught out by a junk mailer who found that my mailform had a gaping hole in it. See my page about how a PHP script can foolishly allow a mailform to be used to send spam:
Mailform abuse by header injection.
In short: Javascript is only useful to help guide users when they use your form; it is no defence at all against abuse of your script.