mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore(curriculum): rm videos from number methods and conditional lecture blocks (#61604)
This commit is contained in:
committed by
GitHub
parent
f34a99520c
commit
9215009a59
+1
-8
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 672d26917a8ab3220c038a42
|
||||
title: How Do Comparisons Work with Null and Undefined Data Types?
|
||||
challengeType: 11
|
||||
videoId: LFaWJYxUkds
|
||||
challengeType: 19
|
||||
dashedName: how-do-comparisons-work-with-null-and-undefined-data-types
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
How do comparisons work with `null` and `undefined` data types?
|
||||
|
||||
In JavaScript, `null` and `undefined` are two distinct data types that represent the absence of a value, but they behave differently in comparisons. Understanding how these types interact in various comparison scenarios is crucial for writing robust and bug-free code.
|
||||
|
||||
Let's start with the `undefined` type. A variable is `undefined` when it has been declared but hasn't been assigned a value. It's the default value of uninitialized variables and function parameters that weren't provided an argument.
|
||||
|
||||
+1
-8
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 673282bea35dbf129efb63d6
|
||||
title: What Are Switch Statements and How Do They Differ from If/Else Chains?
|
||||
challengeType: 11
|
||||
videoId: 3qSSecohwrc
|
||||
challengeType: 19
|
||||
dashedName: what-are-switch-statements-and-how-do-they-differ-from-if-else-chains
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
What are `switch` statements and how do they differ from `if/else if/else` chains?
|
||||
|
||||
`switch` statements and `if/else if/else` chains are both control flow structures in programming that allow us to execute different code blocks based on certain conditions. However, they have distinct characteristics and use cases.
|
||||
|
||||
A `switch` statement evaluates an expression and matches its value against a series of `case` clauses. When a match is found, the code block associated with that `case` is executed. Here's a basic structure of a `switch` statement:
|
||||
|
||||
+1
-8
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 672d26809d388621ad1ecd43
|
||||
title: How Does isNaN Work?
|
||||
challengeType: 11
|
||||
videoId: lxK56X8Rr1M
|
||||
challengeType: 19
|
||||
dashedName: how-does-isnan-work
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
What is `NaN`, and how does `isNaN` work?
|
||||
|
||||
In JavaScript, `NaN` stands for "Not a Number". It's a special value that represents an unrepresentable or undefined numerical result. `NaN` is a property of the global object, and it's also considered a type of number in JavaScript, which might seem counterintuitive at first.
|
||||
|
||||
`NaN` is typically the result of operations that should return a number but can't produce a meaningful numerical value. For example:
|
||||
|
||||
+1
-8
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 6732808f3221720adc833e81
|
||||
title: How Do the parseFloat() and parseInt() Methods Work?
|
||||
challengeType: 11
|
||||
videoId: 5Q_BlR2NKYk
|
||||
challengeType: 19
|
||||
dashedName: how-do-the-parsefloat-and-parseint-methods-work
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
How do the `parseFloat()` and `parseInt()` methods work?
|
||||
|
||||
`parseFloat()` and `parseInt()` are two essential methods in JavaScript for converting strings to numbers. These methods are particularly useful when dealing with user input or processing data that comes in string format but needs to be treated as numerical values.
|
||||
|
||||
Let's start with `parseFloat()`. This method parses a string argument and returns a floating-point number. It's designed to extract a number from the beginning of a string, even if the string contains non-numeric characters later on. Remember that floats are numbers with decimal points. Here's how `parseFloat()` works:
|
||||
|
||||
+1
-8
@@ -1,19 +1,12 @@
|
||||
---
|
||||
id: 673280a1c29d0a0b17316e56
|
||||
title: What Is the toFixed() Method, and How Does It Work?
|
||||
challengeType: 11
|
||||
videoId: 4GnMICoBC1Y
|
||||
challengeType: 19
|
||||
dashedName: what-is-the-tofixed-method-and-how-does-it-work
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Watch the video or read the transcript and answer the questions below.
|
||||
|
||||
# --transcript--
|
||||
|
||||
What is the `.toFixed()` method, and how does it work?
|
||||
|
||||
The `.toFixed()` method is a built-in JavaScript function that formats a number using fixed-point notation. It's particularly useful when you need to control the number of decimal places in a number, especially for displaying currency values or when working with precise measurements.
|
||||
|
||||
The `.toFixed()` method is called on a number and takes one optional argument, which is the number of digits to appear after the decimal point. It returns a string representation of the number with the specified number of decimal places. Here's a basic example of how `.toFixed()` works:
|
||||
|
||||
Reference in New Issue
Block a user