javascript Flashcards

(30 cards)

1
Q

Q: JavaScript is mainly used for:
A) Database management
B) Client-side scripting
C) Operating systems
D) Networking

A

Client-side scripting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: Which tag is used to write JavaScript in an HTML page?
A) <js>
B) <javascript>
C)


D) <code></code>
</javascript></js>

A
<script>

</script>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: Which function is used to display a message box in JavaScript?
A) print()
B) display()
C) alert()
D) message()

A

alert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: Which function is used to take input from the user in JavaScript?
A) alert()
B) prompt()
C) input()
D) read()

A

prompt()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: Which function is used to convert a string into an integer?
A) convertInt()
B) parseInt()
C) stringInt()
D) toNumber()

A

parseInt()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

________ is a scripting language used to make web pages interactive.

A

JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The ________ tag is used to include JavaScript in HTML.

A
<script>

</script>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The ________ function displays a message in a pop-up box.

A

alert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The ________ function is used to take input from the user.

A

prompt()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In JavaScript, ________ are used to store values.

A

Variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

JavaScript is a programming language used for web pages.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

JavaScript code is written inside the

 tag.

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The alert() function takes input from the user.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

JavaScript can perform calculations.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Variables cannot be used in JavaScript.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q: Which operator is used for addition in JavaScript?
A) *
B) -
C) +
D) /

17
Q

Q: Which operator is used to check equality in JavaScript?
A) =
B) ==
C) ===
D) !=

18
Q

Q: Which loop repeats a block of code multiple times?
A) select
B) if
C) for
D) choose

19
Q

Q: Which keyword is used to declare a variable in JavaScript?
A) integer
B) variable
C) var
D) number

20
Q

Q: Which statement is used for decision making in JavaScript?
A) repeat
B) if
C) loop
D) goto

21
Q

The ________ operator is used for multiplication in JavaScript.

22
Q

The ________ statement is used to execute code when a condition is true.

23
Q

________ are used to perform operations on values.

24
Q

The ________ loop is commonly used to repeat a set of statements.

25
The ________ function converts a string into a number.
parseInt()
26
javascript supports arithmetic operations like addition and subtraction
true
27
the 'if' statement is used for decision making
true
28
loops are used to repeat a block of code
true
28
the 'var' keyword cannot be used in javascript
false
29
javascript can interact with users through alert and prompt boxes
true