Fundamentals Flashcards

(38 cards)

1
Q

What is javascript?

A

A high-level, Object Oriented, Multi-Paradigm Programming language

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

What is a value?

A

Piece of data

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

What is a variable?

A

A named reference to a variable. It is a boxed that we store to values

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

What are the rules of declaring a variable?

A
  1. It is declared with the camelCase notition
  2. Variable names can’t start with a number
  3. Variable names can only include letters, numbers, _ and $
  4. Variable names can’t use reserved keywords.
  5. Variable names shouldn’t start with a Capital letter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the primitive data types?

A

String, Number, Boolean, undefined, null, symbol and bigint

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

What is a string?

A

A sequence of characters used to represent text.

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

What is a number

A

Number is a numeric data type

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

What is a boolean?

A

A logical data type that can only have true or false as values.

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

What is a undefined data type?

A

A value that is automatically assigned to a variable that is just been declared.

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

What is a null data type?

A

a value that represents a reference that points to a nonexistent or invalid object or address.

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

What does Dynamic typing in a language mean?

A

The data type of the value is automatically defined. The programmer doesn’t need to do this manually.

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

How can you declare a variable?

A

With the const, let and var keywords.

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

What does reassigning and mutate mean?

A

Changing the value of the variable.

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

Why should you only use let or const instead of var

A

Because it will be block scoped and not function scoped

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

What do operators do?

A

Allows us to transform and/or multiply values

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

What is a syntax?

A

The structure of statements in a computer language

17
Q

What are some basic math operators

A

+, -, /, *, **

18
Q

What do assignment operators do?

A

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

19
Q

What do comparison operators do?

A

A comparison operator compares its operands and returns a logical value based on whether the comparison is true.

20
Q

What is operator precedence?

A

Operator precedence determines how operators are parsed concerning each other. Which operator executes first?

21
Q

What the syntax of template literal?

22
Q

How to use multiple lines when using string operators?

23
Q

How is the structure of the if else statement called?

A

control structure.

24
Q

What is type conversion?

A

Type conversion (or typecasting) means transfer of data from one data type to another.

25
What is type coercion?
Type coercion is the automatic or implicit conversion of values from one data type to another (such as strings to numbers).
26
How can you convert a data type into a number
With the Number() primitive wrapper function.
27
What is the outcome of this syntax: Number('hello')?
NaN (Not a Number)
28
In to which data types can js coerce?
String, Number, Boolean
29
Which operator triggers a number coercion?
the -
30
Which operator triggers a string coercion?
+, /, *
31
What are falsy and truethly values?
They are not false or true, but will be if the are converted into a boolean.
32
What are the falsly values?
0, '', undefined, NaN and Null.
33
What is the difference between a strict logical operator and a loose logical operator?
The strict logical operator (===) does not execute type coercien, which the loose operator (==) does.
34
What does the strict inequity operator do (!==)?
The strict inequality operator (!==) checks whether its two operands are not equal, returning a Boolean result.
35
What are the logical operators?
And (&&), Or (||) & not (!)
36
Is this syntax true or false? | if (12 === 12 && 2 === 1)
false, and operator only returns true if all conditions are true.
37
When doe the OR operator return the value true?
When at least one condition is true.
38
Which logical operator will execute first? &&, ! or ||
!, because the not operator has a higher precedence than the other operators.