Flashcards
Data Types and Conditionals
Cards in this deck (17)
- 1What are the eight data types in JavaScript?Number, String, Boolean, Object, Function, Synbol, BigInt and Undefined
- 2Which data type is NOT primitive?Object
- 3What is the relationship between null and undefined?They're equally false but have different meanings
- 4What is the difference between single, double, and backtick quotes for strings?There is no functional difference between single and double quotes for strings. Backtick quotes (`) allow for variable interpolation using ${} and also support multiline strings.
- 5What is the term for joining strings together?Concatenation
- 6Which type of quote lets you embed variables/expressions in a string?Backtick Quotes
- 7How do you embed variables/expressions in a string?Using interpolation ${variable} inside the backtick quotes
- 8How do you use escape characters in a string?Using backslash (\) before the character to escape it
- 9What is the difference between the slice/substring string methods?In substring method, values less than 0 are treated as 0, while in slice method, negative values count from the end of the string
- 10What are the three logical operators, and what do they stand for?&& = and: return true if both operands are true
|| = or: return true if at least one operand is true
! = not: return true if the operand is false, or false if the operand is true - 11What are the comparison operators?>
>=
<
<=
==
=== - 12What are truthy and falsy values?false, 0, empty string "", null, undefined, NaN
All other values are considered truthy - 13What are conditionals?Conditionals are statemenets that execute blocks of code based on true or false conditions
- 14What is the syntax for an if/else conditional?if (condition) {
// do something
} else {
// do something else
} - 15What is the syntax for a switch statement?switch (variable) {
case A:
// do something
break;
case B:
// do something
break;
// ...
default:
// do something
// break optional
} - 16What is the syntax for a ternary operator?conditional ? do something : do something else
- 17What is nesting?Nesting is a technique in programming where you place code structures inside other code structures, making the organization and visualization of the code easier
Information
- Description
- Técnico Javascript Flashcards on Data Types and Conditionals, created by Lucas Bastos on 10/10/2024.
- Created by
- Lucas Bastos
- Views
- 0
- Rating