This content originally appeared on DEV Community and was authored by Jennifer Tieu
Today I completed The Odin Project JS Fundamentals Part 2 Knowledge Check Section after reviewing all of the materials.
Knowledge Check
- What are the eight data types in JavaScript? Numbers, BigInt, Strings, null, undefined, Boolean, Objects, Symbols
- Which data type is NOT primitive? Objects
-
What is the relationship between null and undefined?
The expression,
null == undefined
, returns true when using the loose equality operator, "==", but not for, "===" - What is the difference between single, double, and backtick quotes for strings? Single and double both behave the same. Backtick quotes can format strings with variables and expressions.
- What is the term for embedding variables/expressions in a string? Template literals
- Which type of quote lets you embed variables/expressions in a string? Backticks
- How do you embed variables/expressions in a string? ${...}
- How do you escape characters in a string? Put a blackslash, "\", in front of a character
- What are methods? Actions performed on Objects
- What is the difference between slice/substring/substr? Slice extracts a part of a string and returns the extracted part in a new string. Substring is similar to slice, but can't use negatives indices Substr is similar to slice, but the second parameter specifies the length of the extracted part.
- What are the three logical operators and what do they stand for? && (AND), || (OR), ! (NOT)
- What are the comparison operators? Operators that compare values between operands
- What are truthy and falsy values? Values that return the boolean value true or false
- What are the falsy values in JavaScript? 0, empty string, null, NaN, and undefined
- What are conditionals? evaluates whether a statement/expression is true or false
- What is the syntax for an if/else conditional? Refer to end
- What is the syntax for a switch statement? Refer to end
-
What is the syntax for a ternary operator?
condition ? value1: value2;
- What is nesting? Putting a statement inside of another statement, therefore nesting them.
For Question 16:
if {
...
} else {
...
}
For Question 17:
switch (condition) {
case a:
code block
break
default:
code block
}
Resources
The Odin Project Landing Page Project
This content originally appeared on DEV Community and was authored by Jennifer Tieu
Jennifer Tieu | Sciencx (2021-12-31T22:12:18+00:00) Self-Taught Developer Journal, Day 29: TOP JavaScript Fundamentals Part 2 – Practice and Knowledge Check. Retrieved from https://www.scien.cx/2021/12/31/self-taught-developer-journal-day-29-top-javascript-fundamentals-part-2-practice-and-knowledge-check/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.