1/35
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is JavaScript (JS)?
A scripting/programming language (the Verb of the web).
Is JS case-sensitive?
Yes.
What keyword declares a constant (non-reassignable) variable?
const
What keyword declares a reassignable variable?
let
What is the scope of a variable declared outside a function?
Global Scope.
What is the scope of a variable declared inside a function?
Local Scope.
What does DOM stand for?
Document Object Model.
What is the DOM?
The browser's tree-like representation of the HTML structure.
What method selects the first element matching a CSS selector?
document.querySelector()
What property changes an element's text content safely?
.textContent (Does not interpret HTML)
What property changes an element's content and allows HTML tags?
.innerHTML
Why is .textContent safer than .innerHTML?
It prevents Cross-Site Scripting (XSS).
What method is used to create a new HTML tag/node?
document.createElement()
What method inserts a new node into an existing element?
parentElement.appendChild()
What is a function?
A reusable block of code to perform a specific task.
What is the shorthand syntax for a function?
Arrow Function (=>).
What built-in method displays a simple message box?
alert()
What built-in method displays a box and returns true or false?
confirm()
What built-in method asks the user for text input?
prompt()
What method calls a function repeatedly at set time intervals?
setInterval()
What event fires when the user clicks an element?
onclick
What storage mechanism saves data across browser sessions?
localStorage.
What does JSON stand for?
JavaScript Object Notation.
What is JSON primarily used for?
A text format for exchanging structured data.
What method converts a JS object to a JSON string?
JSON.stringify()
What method converts a JSON string back to a JS object?
JSON.parse()
What JS data structure stores data in key-value pairs?
Object.
What JS data structure stores an indexed collection of values?
Array.
How is a value accessed in a JS Array?
By its index value (starting at 0).
Which Array method executes a function for each item?
forEach()
Which loop is used when the number of iterations is known?
for loop.
Which loop executes its code block at least once?
do-while loop.
What tool is used to define a pattern for string validation?
Regular Expressions (RegEx).
In RegEx, what character marks the start of a string?
^ (caret).
In RegEx, what character marks the end of a string?
$ (dollar sign).
Why is client-side validation alone insufficient for data security?
It can be disabled by the user