fix(curriculum): Consolidated comments for JavaScript Algorithms and Data Structures challenges - part 1 of 4 (#38258)
* fix: consolidate/remove comments * fix: remove => from comment * fix: reverted changes to add same changes to another PR * fix: removed 'the' from sentence Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> * fix: removed 'the' from the sentence Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@@ -61,13 +61,12 @@ tests:
|
||||
```js
|
||||
function filteredArray(arr, elem) {
|
||||
let newArr = [];
|
||||
// change code below this line
|
||||
// Only change code below this line
|
||||
|
||||
// change code above this line
|
||||
// Only change code above this line
|
||||
return newArr;
|
||||
}
|
||||
|
||||
// change code here to test different cases:
|
||||
console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3));
|
||||
```
|
||||
|
||||
@@ -83,13 +82,11 @@ console.log(filteredArray([[3, 2, 3], [1, 6, 3], [3, 13, 26], [19, 3, 9]], 3));
|
||||
```js
|
||||
function filteredArray(arr, elem) {
|
||||
let newArr = [];
|
||||
// change code below this line
|
||||
for (let i = 0; i<arr.length; i++) {
|
||||
if (arr[i].indexOf(elem) < 0) {
|
||||
newArr.push(arr[i]);
|
||||
}
|
||||
}
|
||||
// change code above this line
|
||||
return newArr;
|
||||
}
|
||||
```
|
||||
|
@@ -72,9 +72,9 @@ tests:
|
||||
|
||||
```js
|
||||
function countOnline(usersObj) {
|
||||
// change code below this line
|
||||
// Only change code below this line
|
||||
|
||||
// change code above this line
|
||||
// Only change code above this line
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -58,9 +58,9 @@ let user = {
|
||||
};
|
||||
|
||||
function addFriend(userObj, friend) {
|
||||
// change code below this line
|
||||
// Only change code below this line
|
||||
|
||||
// change code above this line
|
||||
// Only change code above this line
|
||||
}
|
||||
|
||||
console.log(addFriend(user, 'Pete'));
|
||||
|
@@ -65,9 +65,9 @@ let userActivity = {
|
||||
}
|
||||
};
|
||||
|
||||
// change code below this line
|
||||
// Only change code below this line
|
||||
|
||||
// change code above this line
|
||||
// Only change code above this line
|
||||
|
||||
console.log(userActivity);
|
||||
```
|
||||
|
@@ -51,9 +51,9 @@ let foods = {
|
||||
strawberries: 27
|
||||
};
|
||||
|
||||
// change code below this line
|
||||
// Only change code below this line
|
||||
|
||||
// change code above this line
|
||||
// Only change code above this line
|
||||
|
||||
console.log(foods);
|
||||
```
|
||||
|
Reference in New Issue
Block a user