Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eee3861

Browse files
committed
Update week3 homework
1 parent 29b9d2f commit eee3861

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

JavaScript1/Week3/homework.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,29 @@ Please add your freecodecamp username as answer for this exercise!
2525

2626
### Item array removal
2727

28+
Remove the item in `names` that is equal to `nameToRemove`
29+
30+
Copy the code below to your homework
31+
2832
```js
2933

30-
const numbersArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
31-
const randomNumber = parseInt(Math.random() * 11);
34+
const names = ['Peter', 'Ahmad', 'Yana', 'kristina', 'Rasmus', 'Samuel', 'katrine', 'Tala'];
35+
const nameToRemove = 'Ahmad';
3236

3337
// Write some code here
3438

35-
```
36-
Copy the above code to your homework
39+
// Code done
3740

38-
1. Remove the item in `numbersArray` that is equal to `randomNumber`
39-
1. *Optional* create a variable `numbersToRemove`. In a loop remove the number of items equal to `numbersToRemove`. Remember to have randomNumber inside of the forloop
41+
console.log(names); // ['Peter', 'Yana', 'kristina', 'Rasmus', 'Samuel', 'katrine', 'Tala']
42+
```
4043

4144
---
4245

4346

4447
### When will we be there??
4548
Write a function where you speficy your speed in `km/h` and how far you have to go in `km`. The function has to return the time it will take to arrive at your destination. The time should be formatted like this: `3 hours and 34 minutes`.
4649

47-
```
50+
```js
4851
const speed = 50;
4952
const destinationDistance = 432;
5053
const travelTime = notThisFunctionName(speed, destinationDistance);
@@ -210,7 +213,7 @@ Come up with a unique feature **you think would make this app better.** Write do
210213

211214
Try an **interactive version 💻 of your code** [here](https://codepen.io/hackyourfuture-cph/pen/GeMzdE). Remember to insert your code in the top of the codepen :)
212215

213-
### CactusIO-interactive (Smart phone usage app)
216+
### CactusIO-interactive (Smart phone usage app) *optional*
214217
> After a long day you come home to relax. The first thing you do is find your phone and start watching some youtube. Then check facebook, and then reading some news. Suddently a hour has passed. What happened to all that time you think to yourself. Maybe we can create some program to help with this problem! What if we could help users manage their smart phone usage?
215218
216219
Its going to work like this: A user can add smartphone activities. Then he can see a status on how his smartphone usage is going.

0 commit comments

Comments
 (0)