docs: 1 december -section 3 (func expression and parameters) #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
introduces several new JavaScript examples demonstrating modern function features, including arrow functions, default parameters, rest parameters, and callback functions. The changes focus on teaching best practices and usage patterns for these features through practical code challenges and sample implementations.
Arrow Functions and Refactoring
speedWarningfunction to use two parameters (speed limit and actual speed) and only warn drivers exceeding the limit inchallange.js.index.jsandfunction-expression/index.js, including single-parameter, multi-parameter, and conditional logic cases. [1] [2]Array Methods and Inline Functions
.map()to convert miles to kilometers in a concise format ininline-arrow-function/index.js..reduce()with an inline arrow function to calculate total cost from an array of item objects inchallange-1/index.jsand provided a sample items array initemsBoughtArr.js. [1] [2]Default Parameters
default-params/index.js.Rest Parameters and Dynamic Arguments
Callback Functions
callback-function/index.js.