The link doesn’t seem to work now but it looks like the tutorial is for browser JavaScript. Unity’s JavaScript is similar to the kind available in a browser but it doesn’t have the same browser functionality and so tutorials like this won’t work with Unity.