Morden Javascript Tutorial Chapter 3.1 - Code Quailty

3.1 Debugging in the browser Debugging is the process of finding and fixing errors with a script. All morden browsers and most other environments support debugging tools - a special UI in developer tools that makes debugging much easier. It also allows to trace the code step by step to see what exactly is going on. The “Sources” panel The Sources panel has 3 parts: The File Navigator pane lists HTML, Javascript, CSS and other files, including images that are attatched to the page. Chrome extensions may appera here too. The Code Editor pane shows the source code. The Javascript Debugging pane is for debugging, we’ll explore it soon. Console 按 Esc 可以打开控制台,在其中可以输入命令,按回车执行。 ...

October 23, 2025 · 1 min · 189 words · Starslayerx

Morden Javascript Tutorial Chapter 2 - Fundamentals: 11~18

2.11 Logical operators There are four logical operators in JavaScript: || (ORA), && (AND), ! (NOT), ?? (Nullish Coalescing 空值合并). || OR result = a || b There are four logical combinations: alter( true || true ); // true alert( false || true ); // true alert( true || false ); // true alert( false || false ); // false If an operand is not a boolean it’s converted to be a boolean for the evaluation. if (1 || 0) { // works like (true || false) alter('truthy!'); } OR “||” finds the first truthy value result = value1 || value2 || value3 The OR || operator does the following: ...

September 21, 2025 · 22 min · 4603 words · Starslayerx

Morden Javascript Tutorial Chapter 2 - Fundamentals: 06~10

2.6 Interaction: alert, prompt, confirm Will introduce alert, prompt and confirm in this chapter. alert It shows a message and waits for the user to press “OK”. alert("Hello"); prompt This function prompt accepts two arguments result = prompt(title, [default]); It shows a modal window with a text message, an input field for the visitor, and the buttons OK/Cancel. title: The text to show the visitor. default: An optional second parameter, the initial value for the input field. ...

September 17, 2025 · 15 min · 3118 words · Starslayerx

Morden Javascript Tutorial Chapter 2 - Fundamentals: 01~05

2.1 Hellow Wrold Firtly, let’s see how to attach a script to a webpage. For server-side environments (like Node.js), you can execute this script with a command like node my.js The “script” tag JavaScript programs can be inserted almost anywhere into an HTML docuemnt using the <script> tag <!DOCTYPE html> <html> <body> <p>Before this script...</p> <script> alert("Hello, World!"); </script> <p>...After the script...</p> </body> </html> The <script> tag contains JavaScript code which is automatically executed when the browser process the tag. ...

September 16, 2025 · 16 min · 3234 words · Starslayerx

Morden Javascript Tutorial Chapter 1 - An Introduction

An Introduction to JavaScript Let’s see what’s so special about JavaScript, what we can achieve with it, and what other technologies play well with it. Why is it call JavaScript? JavaScript initially called “Live Script”. But Java was popular at that time, so it was decided that positioning a new language as a “younger brother” of Java would help. But as it evolved, JavaScript became a fully independent language with its won specification called ECMAScript, and now it has no relation to Java at all. ...

September 15, 2025 · 3 min · 622 words · Starslayerx