It is technically not possible to disallow the client to view and modify the code on the client-side, nor block the user from using the command line of his favorite DevTool. See also How to disable browser developer tools?.
What you can do is to obfuscate your JavaScript code using a minifier. This makes it harder for users to read your code, though they can still copy it and do with it what they want.
When your code is copyrighted, you should explicitly mention that on your website, e.g. within a separate terms & conditions page. If you offer files for download, you should include the copyright information within those files.
Also note that in order to protect your website against hacker attacks, you must validate user input on the server side.