1D0-720 · Question #38
In JavaScript, what is the purpose of variables?
The correct answer is A. To store and manipulate data values. Variables in JavaScript act as named containers that store and manipulate data values - numbers, strings, objects, etc. - allowing programs to track and transform information throughout execution. Option B describes CSS or HTML's role in page layout, not JavaScript variables…
Question
In JavaScript, what is the purpose of variables?
Options
- ATo store and manipulate data values
- BTo define the layout of a webpage
- CTo link JavaScript to HTML documents
- DTo create graphical elements on the web page
How the community answered
(35 responses)- A91% (32)
- B3% (1)
- C6% (2)
Explanation
Variables in JavaScript act as named containers that store and manipulate data values - numbers, strings, objects, etc. - allowing programs to track and transform information throughout execution. Option B describes CSS or HTML's role in page layout, not JavaScript variables. Option C refers to <script> tags or src attributes used to link JS files to HTML, which is a separate concept. Option D describes the Canvas API or SVG elements, which are entirely different browser features.
Memory tip: Think of a variable as a labeled box - you name it, you put something in it, and you can take that something out or change it later. "Store and manipulate" maps directly to what boxes do: hold things and let you swap the contents.
Topics
Community Discussion
No community discussion yet for this question.