JavaScript Introduction Terms Flashcards

Basic terms, defining variables, strings, booleans, operators, etc.

1
Q

What is JavaScript?

A

It is a programming language that powers the dynamic behavior on most websites. Alongside HTML and CSS, it is a core technology that makes the web run.

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

What are Methods?

A

Methods return information about an object and are called by appending an instance with a period “.”, the method name, and parentheses. Example: Math.random(); // Returns a number between 0 and 1

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

What is a console.log()?

A

The console.log() method is used to log or print messages to the console. It can also be used to print objects and other info.

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

What is String Concatenation?

A

In JavaScript, multiple strings can be concatenated together using the “+” operator.

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

What is an Assignment Operator?

A

An assignment operator assigns a value to its left operand based on the value of its right operand.

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

What is the addition assignment operator?

A

+=

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

What is the subtraction assignment operator?

A

-=

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

What is the multiplication assignment operator?

A

*=

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

What is the division assignment operator?

A

/=

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

What is String Interpolation?

A

It is the process of evaluating string literals containing one or more placeholders (expressions, variables, etc). It can be performed using template literals: “text ${expression} text”. “‘Tommy is ${age} years old.’;”

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

What are Variables?

A

A variable is a container for data that is stored in computer memory. It is referenced by a descriptive name that a programmer can call to assign a specific value and retrieve it.

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

What does Undefined mean?

A

“undefined” is a primitive JavaScript value that represents lack of defined value. Variables that are declared but not initialized to a value will have the value “undefined”.

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

How do you declare a variable?

A

To declare a variable in JavaScript, any of these keywords can be used along with a variable name: var, let, and const.

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

When is the variable “var” used?

A

“var” is used in pre-ES6 versions of JavaScript.

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

When is the variable “let” used?

A

“let” is the preferred way to declare a variable when it can be reassigned. A “let” variable will contain “undefined” if nothing is assigned to it.

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

When is the variable “const” used?

A

“const” is the preferred way to declare a variable with a constant value. It must have an assignment. Any attempt of reassigning a “const” variable will result in a JavaScript runtime error.

17
Q

What are Template Literals?

A

Template literals are strings that allow embedded expressions, for example: ${expression}. While regular strings use single ‘ or double “ quotes, template literals use backticks `` instead. Example: console.log(Hello, ${name});

18
Q

What are Built-in Objects?

A

Built-in objects contain methods that can be called by appending the object name with a period “.”, the method name, and a set of parentheses. Example: Math.random(); // “Math” is the built-in object

19
Q

What does String.length mean?

A

The “.length” property of a string returns the number of characters that make up the string. Example: console.log(‘howdy’.length); // Prints: 5

20
Q

What are Booleans?

A

Booleans are a primitive data type. They can either be “true” or “false”. Example: let lateToWork = true;

21
Q

What are Single Line Comments?

A

In JavaScript, single-line comments are created with two consecutive forward slashes //. Example: // This line will denote a comment

22
Q

What does Null mean?

A

Null is a primitive data type. It represents the intentional absence of a value. In code, it is represented as “null”.

23
Q

What are Strings?

A

Strings are a primitive data type. They are any grouping of characters (letters, spaces, numbers, or symbols) surrounded by single quotes ‘ or double “ quotes. Example: let single = ‘Where is my hat?’; or let double = “Where is my hat?”;

24
Q

What is the Remainder / Modulo Operator?

A

The remainder operator, sometimes called modulo, returns the number that remains after the right-hand number divides into the left-hand number as many times as it evenly can. Example: const daysLeftOver = 365 % 7 ;

25
Q
A