Value

Values assigned to a variable can be a simple literal, an expression, an object, or a function.

If you open this HTML file in your browser, you will be alerted with the messages '1', '2', '3', in that sequence. As you click the 'start' button, you will be alerted with '30' and then 'hello', assuming you keyed in 'hello' in the text box.In HTML, you can code JavaScript in a separate file, in the section, in the section, or in the event attributes within tags. The codes will be executed in the order they appear, unless it is an event or 'defer' is used. If 'defer' is used to run external JavaScript, the execution will be delayed until the entire document has been loaded./* … */ denotes block comments. A line comment is denoted by //. Some browsers may also allow you to use to denote line comments. Comments make the code easier to understand.To debug JavaScript code, it is often helpful to bring out the Console screen (by pressing F12 on the keyboard on most browsers), which shows any error messages. You can use the 'debugger;' JavaScript statement to pause execution and step through function calls in real-time.