JavaScript に関する記述として, 適切なものはどれか。
令和6年度 ITパスポート試験 問88
This question's explanation and your answers so far.
問 88
- ア
正解 JavaScript is a scripting language that runs in a web browser. With HTML alone a page would be static, and JavaScript is used to embed “dynamic behavior” such as reacting to button clicks, validating input, and dynamically updating what is displayed. Therefore, choice ア, which says that “it can embed dynamic behavior and the like into a web browser,” is appropriate.
Incorrectイ
JavaScript is originally a client-side language that runs in a web browser. The statement that “it runs only on a web server, not in a web browser” is the opposite of the truth and is incorrect.
Incorrectウ
JavaScript is a scripting (interpreted) language that interprets its source code at run time, so it does not need to be compiled in advance. The statement that “it must be compiled in advance in order to be executed” is incorrect.
Incorrectエ
JavaScript and Java are different languages that merely have similar names; their syntax and uses differ. The statement that it is “the script version of Java” is incorrect, a trap based on the similarity of the names.
- JavaScript is a scripting language that runs in a web browser and gives web pages dynamic behavior (no compilation needed before execution).
- JavaScript and Java are different languages that only have similar names; do not confuse them.