JS Basics Flashcards

1
Q

Define what Syntax means for programming

A

Syntax is the rules of a language, a programs commands, special words, and punctuation

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

Do statements have to have a semi colon at the end?

A

False, as long as there isn’t more than one statement on that line of code

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

You can run Javascript within a script tag that already has a source attribute that points to a external javascript file?

A

False

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

Define “var”

A

Declares a variable, optionally initialing it to a value

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

Define “let”

A

Declares a block-scoped, local variable, optionally initializing it to a value

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

Define “constant”

A

Declares a block-scoped, read-only named constant

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

Define an “identifier”

A

An “identifier” is a sequence of characters in the code that identifies a variable, function, or property

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

Identifiers must start with

A

a letter, underscore, or dollar sign - subsequent characters can be 0-9

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

What methods can either transform characters to all upper case or all lower case?

A

.toUpperCase() or .toLowerCase()

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

The process of combining two or more strings to create a bigger string.

A

String Concatenation

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

What’s the syntax for template literals?

A

A pair of backticks `` and ${} to add other values dynamically

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

What method returns the first Element within the document that matches the specified selector, or group of selectors?

A

document.querySelector()

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

Explain .innerHTML property

A

The element property innerHTML gets or sets the HTML or XML markup contained with the element

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

Define the “if…else”

A

An “if” statement executes a block of code if the statement is true. Otherwise if the statement is false it can execute another statement.

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

What is the sign for the “AND” operator and what is it used for?

A

&& this is used to test multiple conditions in an if statement

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

What’s the sign for the logical operator (OR) and what is its purpose?

A

The logical operator (OR) test if either condition is true, if ONE is true then the boolean returned will be true. The sign is ||

17
Q

Operator that returns a string indicating the type of unevaluated operand

A

( typeof )