Yes, you can code javascript in the editor, just make sure you are in source view before you add the script code. As a test I added:
<script type="text/javascript">
alert("Test 1...2...3...");
</script>
and got the expected alert when the page opened.
Javascript will not display on the page. If you are adding a script tag that connects to a .js file, you should use an absolute URL to the file, not a relative path.