Adding-missing-challenge-solution (#35025)
* Adding-missing-challenge-solution * updating solution as requested added back in //solution required and removing console.log * Adding-solution * Update access-property-names-with-bracket-notation.english.md * adding-solution * Adding-solution
This commit is contained in:
@ -65,5 +65,7 @@ console.log(myArray);
|
||||
|
||||
```js
|
||||
// solution required
|
||||
let myArray = ["a", "b", "c", "d"];
|
||||
myArray[1] = "e";
|
||||
```
|
||||
</section>
|
||||
|
@ -72,5 +72,17 @@ console.log(checkInventory("apples"));
|
||||
|
||||
```js
|
||||
// solution required
|
||||
let foods = {
|
||||
apples: 25,
|
||||
oranges: 32,
|
||||
plums: 28,
|
||||
bananas: 13,
|
||||
grapes: 35,
|
||||
strawberries: 27
|
||||
};
|
||||
|
||||
function checkInventory(scannedItem) {
|
||||
return foods[scannedItem];
|
||||
}
|
||||
```
|
||||
</section>
|
||||
|
@ -57,5 +57,12 @@ console.log(spreadOut());
|
||||
|
||||
```js
|
||||
// solution required
|
||||
|
||||
function spreadOut() {
|
||||
let fragment = ['to', 'code'];
|
||||
let sentence = ['learning', ...fragment, 'is', 'fun'];
|
||||
return sentence;
|
||||
}
|
||||
|
||||
```
|
||||
</section>
|
||||
|
@ -82,5 +82,19 @@ console.log(tea4TeamFCC);
|
||||
|
||||
```js
|
||||
// solution required
|
||||
const prepareTea = () => 'greenTea';
|
||||
|
||||
const getTea = (numOfCups) => {
|
||||
const teaCups = [];
|
||||
|
||||
for(let cups = 1; cups <= numOfCups; cups += 1) {
|
||||
const teaCup = prepareTea();
|
||||
teaCups.push(teaCup);
|
||||
}
|
||||
|
||||
return teaCups;
|
||||
};
|
||||
|
||||
const tea4TeamFCC = getTea(40);
|
||||
```
|
||||
</section>
|
||||
|
@ -98,5 +98,20 @@ console.log(
|
||||
|
||||
```js
|
||||
// solution required
|
||||
const prepareGreenTea = () => 'greenTea';
|
||||
const prepareBlackTea = () => 'blackTea';
|
||||
|
||||
const getTea = (prepareTea, numOfCups) => {
|
||||
const teaCups = [];
|
||||
|
||||
for(let cups = 1; cups <= numOfCups; cups += 1) {
|
||||
const teaCup = prepareTea();
|
||||
teaCups.push(teaCup);
|
||||
}
|
||||
return teaCups;
|
||||
};
|
||||
|
||||
const tea4BlackTeamFCC = getTea(prepareBlackTea, 13);
|
||||
const tea4GreenTeamFCC = getTea(prepareGreenTea, 27);
|
||||
```
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user