Javascript Web Dev 1 (knowt friendly)

0.0(0)
studied byStudied by 1 person
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/35

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

36 Terms

1
New cards

What is JavaScript (JS)?

A scripting/programming language (the Verb of the web).

2
New cards

Is JS case-sensitive?

Yes.

3
New cards

What keyword declares a constant (non-reassignable) variable?

const

4
New cards

What keyword declares a reassignable variable?

let

5
New cards

What is the scope of a variable declared outside a function?

Global Scope.

6
New cards

What is the scope of a variable declared inside a function?

Local Scope.

7
New cards

What does DOM stand for?

Document Object Model.

8
New cards

What is the DOM?

The browser's tree-like representation of the HTML structure.

9
New cards

What method selects the first element matching a CSS selector?

document.querySelector()

10
New cards

What property changes an element's text content safely?

.textContent (Does not interpret HTML)

11
New cards

What property changes an element's content and allows HTML tags?

.innerHTML

12
New cards

Why is .textContent safer than .innerHTML?

It prevents Cross-Site Scripting (XSS).

13
New cards

What method is used to create a new HTML tag/node?

document.createElement()

14
New cards

What method inserts a new node into an existing element?

parentElement.appendChild()

15
New cards

What is a function?

A reusable block of code to perform a specific task.

16
New cards

What is the shorthand syntax for a function?

Arrow Function (=>).

17
New cards

What built-in method displays a simple message box?

alert()

18
New cards

What built-in method displays a box and returns true or false?

confirm()

19
New cards

What built-in method asks the user for text input?

prompt()

20
New cards

What method calls a function repeatedly at set time intervals?

setInterval()

21
New cards

What event fires when the user clicks an element?

onclick

22
New cards

What storage mechanism saves data across browser sessions?

localStorage.

23
New cards

What does JSON stand for?

JavaScript Object Notation.

24
New cards

What is JSON primarily used for?

A text format for exchanging structured data.

25
New cards

What method converts a JS object to a JSON string?

JSON.stringify()

26
New cards

What method converts a JSON string back to a JS object?

JSON.parse()

27
New cards

What JS data structure stores data in key-value pairs?

Object.

28
New cards

What JS data structure stores an indexed collection of values?

Array.

29
New cards

How is a value accessed in a JS Array?

By its index value (starting at 0).

30
New cards

Which Array method executes a function for each item?

forEach()

31
New cards

Which loop is used when the number of iterations is known?

for loop.

32
New cards

Which loop executes its code block at least once?

do-while loop.

33
New cards

What tool is used to define a pattern for string validation?

Regular Expressions (RegEx).

34
New cards

In RegEx, what character marks the start of a string?

^ (caret).

35
New cards

In RegEx, what character marks the end of a string?

$ (dollar sign).

36
New cards

Why is client-side validation alone insufficient for data security?

It can be disabled by the user