How to create alerts

Ok, so I know how to make a an alert box with JS, but whenever I try to use the function in unity, it says it doesn’t recognize the function. Please help

unity javascript is NOT javascript.

It’s unityscript, which is poorly called javascript (even by the creators). It’s inspired by the syntax of javascript, but does not contain the same api as javascript, and instead compiles into CIL (the intermediate language used by mono/.net).

There is no Alert box.

If you want a graphical alert box, you need to draw your own, and wire it up manually.

If all you’re trying to do is log out a debug message. Use:
Debug.Log(…)
or
print(…)