Javascript Flashcards

1
Q

What is JavaScript used for?

A

used to create responsive, interactive elements for webpages that enhances user experience.

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

Is JavaScript considered as a programming language?

A

Yes.

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

Where can you insert JavaScript?

A

In head element, in body element, external file or external URL

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

What can JavaScript do?

A

It can change HTML content, change HTML attributes, Change CSS style, Show and hide HTML elements.

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

You do not need to add the type attribute in script tag. True or false.

A

True

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

The language attribute for the script tag is necessary. True or False?

A

False.

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

Is external file paid? (JavaScript)

A

No. Only external URL is paid.

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

How do you add external file or external URL? (JavaScript)

A

By adding the src attribute inside script start tag.

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

Does the script tag need an end tag?

A

Yes.

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

What are statements in JavaScript?

A

are syntax constructs and commands that perform actions.

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

Statements are separated using colons (:). True or false?

A

False. You have to use semi colons. (;)

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

How do you make a one-line comment in JavaScript?

A

// comment

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

How do you make a multiple line comment in JavaScript.

A

/* just like CSS */

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

The one line comment in JavaScript needs an end tag. True or false.

A

False.

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

Define a variable in JavaScript.

A

used to store values.

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

Name at least one data type/variable type

A

string, number, object, boolean.

17
Q

A string does not require a double quote. True or false?

A

False. Without the double quote, it is not a string.

18
Q

A number requires a double quote. True or false?

A

False. With a double quote, it will become a string. It will not perform the operation as expected, because it is a string not a number value.

19
Q

What can you start your variable name with?

A

a letter, a dollar sign, and an underscore.

20
Q

what does ‘+’ do in JavaScript?

A

It adds the two operands.

21
Q

What does ‘-‘ do in JavaScript?

A

It subtracts.

22
Q

What symbol do you use to multiply in JavaScript?

A

*

23
Q

The forward slash ( / ) is used in JavaScript as an arithmetic operator to divide. True or false?

A

True.

24
Q

What symbol do you use for the modulus operator and what does it do?

A

%. It returns the remainder.

25
Q

What does the increment operator (++) do in JavaScript?

A

It increase value by one.

26
Q

The decrement operator (–) decreases the value by two. True or false?

A

False. It only decreases by one.

27
Q

+= is an assignment operator. True or false?

A

True

28
Q

What does “%=” do in JavaScript?

A

Gets the modulus of the left operand divide by right operand then returns the remainder and assigns the value to left operand.

29
Q

What does “/=” do in JavaScript?

A

It divides the left operand to right operand and assigns the value to left operand.