As I said, in the console. Chrome has built in developer tools and so does Firefox. You can also use Firebug for Firefox and there should be some extensions for IE too.
This is in fact a syntax error and can be caught by your browser (F12).
Some tips:
Create variable names with the keyword var. Your words variable was not created with var.
Don't use the Array constructor. Use the array literal syntax []. That's means change the first line to:
var words = [ 'limit', 'lines', 'finish' ];
Use console.log instead of document.write. You can view the result in your browser by hitting F12. document.write causes problems when used in certain situations so it's best to avoid it.
Uncaught SyntaxError: Unexpected token ;. Stackoverflow is not a debugging service.