diff --git a/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/672d266034b5242126271995.md b/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/672d266034b5242126271995.md index 4d48426b9d9..3bf72f6aaca 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/672d266034b5242126271995.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-working-with-common-string-methods/672d266034b5242126271995.md @@ -12,7 +12,7 @@ Watch the video or read the transcript and answer the questions below. # --transcript-- -what is ASCII and how does it work with `charCodeAt()` and `fromCharCode()`? +What is ASCII and how does it work with `charCodeAt()` and `fromCharCode()`? In programming, understanding how characters are represented as numbers is fundamental. This is where ASCII comes in. ASCII, short for American Standard Code for Information Interchange, is a character encoding standard used in computers to represent text. It assigns a numeric value to each character, which is universally recognized by machines. diff --git a/curriculum/challenges/english/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md b/curriculum/challenges/english/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md index 5c0d1649f8e..14498bdd02b 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-working-with-functions/672d269da46786225e3fe3fd.md @@ -22,7 +22,7 @@ function greet() { } ``` -In this example, we have declared a function called `greet`. Inside that function, we have a `console.log` that logs the message `Hello, Jessica!`. If we tried to run this code, we would not see the message appear in the console. This because we need to call the function. +In this example, we have declared a function called `greet`. Inside that function, we have a `console.log` that logs the message `Hello, Jessica!`. If we tried to run this code, we would not see the message appear in the console. This is because we need to call the function. A function call, or or invocation, is when we actually use or execute the function. To call a function, you will need to reference the function name followed by a set of parentheses: diff --git a/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362a34edda41dedf87623.md b/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362a34edda41dedf87623.md index 54f7c860ea9..b1e3ac86d84 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362a34edda41dedf87623.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362a34edda41dedf87623.md @@ -23,8 +23,8 @@ Here is an example of using the `map` method on an array of numbers: ```js const numbers = [1, 2, 3, 4, 5]; const doubled = numbers.map((num) => num * 2); -console.log(numbers); // [1,2,3,4,5] -console.log(doubled); // [2,4,6,8,10] +console.log(numbers); // [1, 2, 3, 4, 5] +console.log(doubled); // [2, 4, 6, 8, 10] ``` To create a new array where each number is doubled, we are using the `map` method. The `map` method accepts a callback function where the function is called on every single element in the array. diff --git a/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362d7f94d551edb532d24.md b/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362d7f94d551edb532d24.md index 696ca248099..de8fdafc88e 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362d7f94d551edb532d24.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-working-with-higher-order-functions-and-callbacks/673362d7f94d551edb532d24.md @@ -38,7 +38,7 @@ Our goal is to sort the array in alphabetical order. We can do this by calling t const fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.sort(); -console.log(fruits); // ["Apple","Banana","Mango","Orange"] +console.log(fruits); // ["Apple", "Banana", "Mango", "Orange"] ``` The result will be a sorted array of fruits in alphabetical order starting with the fruit `Apple`. @@ -55,7 +55,7 @@ If we try to use the `sort` method on this `numbers` array, we will get unexpect const numbers = [414, 200, 5, 10, 3]; numbers.sort(); -console.log(numbers); // [10,200,3,414,5] +console.log(numbers); // [10, 200, 3, 414, 5] ``` We expected to see the result `[3, 5, 10, 200, 414]`, but instead we got `[10, 200, 3, 414, 5]`. @@ -75,7 +75,7 @@ const numbers = [414, 200, 5, 10, 3]; numbers.sort((a, b) => a - b); -console.log(numbers); // [3,5,10,200,414] +console.log(numbers); // [3, 5, 10, 200, 414] ``` The parameters `a` and `b` are the two elements being compared. The compare function should return a negative value if `a` should come before `b`, a positive value if `a` should come after `b`, and zero if `a` and `b` are equal. diff --git a/curriculum/challenges/english/25-front-end-development/lecture-working-with-objects/6732b79c6aa77826855a3f11.md b/curriculum/challenges/english/25-front-end-development/lecture-working-with-objects/6732b79c6aa77826855a3f11.md index 9aa281804de..4daa49aad18 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-working-with-objects/6732b79c6aa77826855a3f11.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-working-with-objects/6732b79c6aa77826855a3f11.md @@ -179,7 +179,7 @@ This method parses a string and returns a usable JavaScript object. Given the following JSON string, how would you convert it back into a JavaScript object and access the `"age"` value? ```js -const jsonString = '{"name": "Alice", "age": 25}'; +const jsonString = '{"name":"Alice","age":25}'; ``` ## --answers-- diff --git a/curriculum/challenges/english/25-front-end-development/review-javascript-arrays/6723c66f623701a3cdf72130.md b/curriculum/challenges/english/25-front-end-development/review-javascript-arrays/6723c66f623701a3cdf72130.md index be3ad1f444e..41484ac2432 100644 --- a/curriculum/challenges/english/25-front-end-development/review-javascript-arrays/6723c66f623701a3cdf72130.md +++ b/curriculum/challenges/english/25-front-end-development/review-javascript-arrays/6723c66f623701a3cdf72130.md @@ -82,7 +82,7 @@ const [first, second, ...rest] = fruits; console.log(first); // "apple" console.log(second); // "banana" -console.log(rest); // ["orange","mango","kiwi"] +console.log(rest); // ["orange", "mango", "kiwi"] ``` ## Common Array Methods @@ -187,14 +187,14 @@ console.log(shallowCopiedArray); // [1, 2, 3, 4] const str = "hello"; const charArray = str.split(""); -console.log(charArray); // ["h","e","l","l","o"] +console.log(charArray); // ["h", "e", "l", "l", "o"] ``` - **`reverse()` Method**: This method reverses an array in place. ```js const desserts = ["cake", "cookies", "pie"]; -console.log(desserts.reverse()); // ["pie","cookies","cake"] +console.log(desserts.reverse()); // ["pie", "cookies", "cake"] ``` - **`join()` Method**: This method concatenates all the elements of an array into a single string, with each element separated by a specified separator. If no separator is provided, or an empty string (`""`) is used, the elements will be joined without any separator. diff --git a/curriculum/challenges/english/25-front-end-development/review-javascript-higher-order-functions/6723ca6c6db3deb21cb1bf19.md b/curriculum/challenges/english/25-front-end-development/review-javascript-higher-order-functions/6723ca6c6db3deb21cb1bf19.md index 9f08151b41e..dd040c2b61a 100644 --- a/curriculum/challenges/english/25-front-end-development/review-javascript-higher-order-functions/6723ca6c6db3deb21cb1bf19.md +++ b/curriculum/challenges/english/25-front-end-development/review-javascript-higher-order-functions/6723ca6c6db3deb21cb1bf19.md @@ -49,8 +49,8 @@ console.log(doubledNumbers); // [2, 4, 6, 8, 10] const numbers = [1, 2, 3, 4, 5]; const doubled = numbers.map((num) => num * 2); -console.log(numbers); // [1,2,3,4,5] -console.log(doubled); // [2,4,6,8,10] +console.log(numbers); // [1, 2, 3, 4, 5] +console.log(doubled); // [2, 4, 6, 8, 10] ``` - **`filter()` Method**: This method is used to create a new array with elements that pass a specified test, making it useful for selectively extracting items based on criteria. Just like the `map` method, the callback function for the `filter` method accepts the same three arguments: the current element being processed, the index, and the array. @@ -95,7 +95,7 @@ console.log(result); // "hello, JavaScript!" const fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.sort(); -console.log(fruits); // ["Apple","Banana","Mango","Orange"] +console.log(fruits); // ["Apple", "Banana", "Mango", "Orange"] ``` If you need to sort numbers, then you will need to pass in a compare function. The `sort` method converts the elements to strings and then compares their sequences of UTF-16 code units values. UTF-16 code units are the numeric values that represent the characters in the string. Examples of UTF-16 code units are the numbers 65, 66, and 67 which represent the characters "A", "B", and "C" respectively. So the number 200 appears before the number 3 in an array, because the string "200" comes before the string "3" when comparing their UTF-16 code units. diff --git a/curriculum/challenges/english/25-front-end-development/review-javascript-strings/6723c1946e4cd7909a836bb4.md b/curriculum/challenges/english/25-front-end-development/review-javascript-strings/6723c1946e4cd7909a836bb4.md index d101c9a1ca2..68c46065a59 100644 --- a/curriculum/challenges/english/25-front-end-development/review-javascript-strings/6723c1946e4cd7909a836bb4.md +++ b/curriculum/challenges/english/25-front-end-development/review-javascript-strings/6723c1946e4cd7909a836bb4.md @@ -133,7 +133,7 @@ const text = " Hello, world! "; console.log(text.trimEnd()); // " Hello, world!" ``` -- **The `prompt()` Method**: This method of thw `window` is used to get information from a user through the form of a dialog box. This method takes two arguments. The first argument is the message which will appear inside the dialog box, typically prompting the user to enter information. The second one is a default value which is optional and will fill the input field initially. +- **The `prompt()` Method**: This method of the `window` is used to get information from a user through the form of a dialog box. This method takes two arguments. The first argument is the message which will appear inside the dialog box, typically prompting the user to enter information. The second one is a default value which is optional and will fill the input field initially. ```js const answer = window.prompt("What's your favorite animal?"); // This will change depending on what the user answers diff --git a/curriculum/challenges/english/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md b/curriculum/challenges/english/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md index cf4b30a849b..d70e97b9e4b 100644 --- a/curriculum/challenges/english/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md +++ b/curriculum/challenges/english/25-front-end-development/review-javascript/6723d3cfdd0717d3f1bf27e3.md @@ -335,7 +335,7 @@ const text = " Hello, world! "; console.log(text.trimEnd()); // " Hello, world!" ``` -- **The `prompt()` Method**: This method of thw `window` is used to get information from a user through the form of a dialog box. This method takes two arguments. The first argument is the message which will appear inside the dialog box, typically prompting the user to enter information. The second one is a default value which is optional and will fill the input field initially. +- **The `prompt()` Method**: This method of the `window` is used to get information from a user through the form of a dialog box. This method takes two arguments. The first argument is the message which will appear inside the dialog box, typically prompting the user to enter information. The second one is a default value which is optional and will fill the input field initially. ```js const answer = window.prompt("What's your favorite animal?"); // This will change depending on what the user answers @@ -745,7 +745,7 @@ const [first, second, ...rest] = fruits; console.log(first); // "apple" console.log(second); // "banana" -console.log(rest); // ["orange","mango","kiwi"] +console.log(rest); // ["orange", "mango", "kiwi"] ``` ## Common Array Methods @@ -850,14 +850,14 @@ console.log(shallowCopiedArray); // [1, 2, 3, 4] const str = "hello"; const charArray = str.split(""); -console.log(charArray); // ["h","e","l","l","o"] +console.log(charArray); // ["h", "e", "l", "l", "o"] ``` - **`reverse()` Method**: This method reverses an array in place. ```js const desserts = ["cake", "cookies", "pie"]; -console.log(desserts.reverse()); // ["pie","cookies","cake"] +console.log(desserts.reverse()); // ["pie", "cookies", "cake"] ``` - **`join()` Method**: This method concatenates all the elements of an array into a single string, with each element separated by a specified separator. If no separator is provided, or an empty string (`""`) is used, the elements will be joined without any separator. @@ -1379,8 +1379,8 @@ console.log(doubledNumbers); // [2, 4, 6, 8, 10] const numbers = [1, 2, 3, 4, 5]; const doubled = numbers.map((num) => num * 2); -console.log(numbers); // [1,2,3,4,5] -console.log(doubled); // [2,4,6,8,10] +console.log(numbers); // [1, 2, 3, 4, 5] +console.log(doubled); // [2, 4, 6, 8, 10] ``` - **`filter()` Method**: This method is used to create a new array with elements that pass a specified test, making it useful for selectively extracting items based on criteria. Just like the `map` method, the callback function for the `filter` method accepts the same three arguments: the current element being processed, the index, and the array. @@ -1425,7 +1425,7 @@ console.log(result); // "hello, JavaScript!" const fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.sort(); -console.log(fruits); // ["Apple","Banana","Mango","Orange"] +console.log(fruits); // ["Apple", "Banana", "Mango", "Orange"] ``` If you need to sort numbers, then you will need to pass in a compare function. The `sort` method converts the elements to strings and then compares their sequences of UTF-16 code units values. UTF-16 code units are the numeric values that represent the characters in the string. Examples of UTF-16 code units are the numbers 65, 66, and 67 which represent the characters "A", "B", and "C" respectively. So the number 200 appears before the number 3 in an array, because the string "200" comes before the string "3" when comparing their UTF-16 code units.