Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you already have such a repository, just go on to the next step.

![See the JSON file](../assets/API-guide-2.png)

❗Be mindful about your data format. Note wether you should use an object or an array of objects and form your file accordingly.
❗Be mindful about your data format. Note whether you should use an object or an array of objects and form your file accordingly.

### Using the API

Expand Down
4 changes: 2 additions & 2 deletions legacy/javascript/javascript1/week1/homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Create a variable called `startupName` that will contain the created startup nam
Using a random index (you choose) of the arrays and concatenation of strings, create and log the new startup name and the number of characters in it.
An example could be: "The startup: "Easy Corporation" contains 16 characters"

Hint: you can use this code to generate a random number from 0-9, if you dont want to specify the indexes yourself.
Hint: you can use this code to generate a random number from 0-9, if you don't want to specify the indexes yourself.

```js
const randomNumber = Math.floor(Math.random() * 10);
Expand All @@ -124,7 +124,7 @@ To be continued...

## Step 4: Hand in Homework

We are going to be handing in homework using something called a **pull request (now PR)**. The reason for that is that **most companies use PR's** when they work with code. So you might aswell get used to it!
We are going to be handing in homework using something called a **pull request (now PR)**. The reason for that is that **most companies use PRs** when they work with code. So you might as well get used to it!

Watch [this video](https://www.youtube.com/watch?v=JcT4wmK1VcA) to go through the same process as is documented here

Expand Down
4 changes: 2 additions & 2 deletions legacy/javascript/javascript1/week1/lesson-plan.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Lesson plan

- Focus on having lots of in class exercises.
- DONT teach everything, let the students investigate topics on their own aswell!
- DON'T teach everything, let the students investigate topics on their own as well!
- Focus on how to read documentation, google answers and google errors!!
- Teach towards the students being able to solve the homework

Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you dont have access, write to one from the core team. You can see an example below!
Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below!

To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork)

Expand Down
8 changes: 4 additions & 4 deletions legacy/javascript/javascript1/week2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const randomNumber = Math.random();
console.log(randomNumber); // logs out some number between 0 and 1
```

Here `Math.random` is a function. To activate the function we call it using paranthesis `()`. When calling it we get a randomNumber! We now dont need to think about all the code it takes to create a random number in javascript, we simply call the function and get a random number. Code has been abstracted away for us!
Here `Math.random` is a function. To activate the function we call it using parentheses `()`. When calling it we get a randomNumber! We now don't need to think about all the code it takes to create a random number in javascript, we simply call the function and get a random number. Code has been abstracted away for us!

Some functions is called with arguments fx:

Expand All @@ -101,7 +101,7 @@ function checkItem() {
}

// use the function by calling it using ()
// If we dont call the function that code will NEVER EVER IN A MILLION YEARS run!
// If we don't call the function that code will NEVER EVER IN A MILLION YEARS run!
checkItem();
console.log(todoItem);
```
Expand Down Expand Up @@ -151,15 +151,15 @@ function sum(a, b) {
const returnedSum = sum(5, 10); // the variable returnedSum captures the return value from calling the function!
console.log(returnedSum); // logs 15

// If we dont return, we cannot capture the returned value!
// If we don't return, we cannot capture the returned value!
function sumNoReturn(a, b) {
a + b; // no return!
}
const returnedSum = sum(5, 10);
console.log(returnedSum); // logs undefined
```

If we dont return anything from the function, it will automatically return `undefined`. This is the functions way of saying that nothing was returned.
If we don't return anything from the function, it will automatically return `undefined`. This is the functions way of saying that nothing was returned.

### Calling a function on something

Expand Down
2 changes: 1 addition & 1 deletion legacy/javascript/javascript1/week2/homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This will create and checkout the branch so you are ready make commits to it

## Why should I even do this homework?

Functions and conditions are some of the basic building blocks of javascript. Functions ensure that we dont repeat ourselves when writing code. Conditions ensures that we can handle different cases when programming.
Functions and conditions are some of the basic building blocks of javascript. Functions ensure that we don't repeat ourselves when writing code. Conditions ensures that we can handle different cases when programming.

If you struggle to do this weeks homework there are a couple of things to do:

Expand Down
22 changes: 11 additions & 11 deletions legacy/javascript/javascript1/week2/lesson-plan.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Lesson plan

- Focus on having lots of in class exercises.
- DONT teach everything, let the students investigate topics on their own aswell!
- DON'T teach everything, let the students investigate topics on their own as well!
- Focus on how to read documentation, google answers and google errors!!
- Teach towards the students being able to solve the homework

Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you dont have access, write to one from the core team. You can see an example below!
Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below!

To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork)

Expand Down Expand Up @@ -118,7 +118,7 @@ function checkItem() {
}

// use the function by calling it using ()
// If we dont call the function that code will NEVER EVER IN A MILLION YEARS run!
// If we don't call the function that code will NEVER EVER IN A MILLION YEARS run!
checkItem();
console.log(todoItem);

Expand Down Expand Up @@ -148,7 +148,7 @@ function sum(a, b) {
const returnedSum = sum(5, 10); // the variable returnedSum captures the return value from calling the function!
console.log(returnedSum); // logs 15

// If we dont return, we cannot capture the returned value!
// If we don't return, we cannot capture the returned value!
function sumNoReturn(a, b) {
a + b; // no return!
}
Expand Down Expand Up @@ -256,9 +256,9 @@ const balance = 1000;

### Function

Create a function called `getCircleArea`. It should have the `radius` of the circle as parameter and return the circle area. What happens if we dont return anything in the function?
Create a function called `getCircleArea`. It should have the `radius` of the circle as parameter and return the circle area. What happens if we don't return anything in the function?

Create a function called `celciusToFahreneit` it should have a parameter called `celcius`. It should return the temperature in fahrenheit.
Create a function called `celsiusToFahrenheit` it should have a parameter called `celsius`. It should return the temperature in fahrenheit.

Try call the function and check with google if the function returns the right value.

Expand Down Expand Up @@ -307,16 +307,16 @@ logString("hello", 3);

### Send emails

Imagine we work at a company. Peter from the HR department wants us to send out a couple of emails to some recepients. The only problem is that he sent us the email in a weird format: `benjamin@gmail.com|peter@gmail.com|hans@gmail.com|ahmad@gmail.com|sana@gmail.com|virgeen@gmail.com|mohammed@gmail.com`
Imagine we work at a company. Peter from the HR department wants us to send out a couple of emails to some recipients. The only problem is that he sent us the email in a weird format: `benjamin@gmail.com|peter@gmail.com|hans@gmail.com|ahmad@gmail.com|sana@gmail.com|virgeen@gmail.com|mohammed@gmail.com`

Use the `sendEmailTo` function to send an email to all the recepients that we got from Peter.
Use the `sendEmailTo` function to send an email to all the recipients that we got from Peter.

_Hint_ use the `.split` method and look up `iterating an array js for loop` on google.

```js
// This function emulates sending emails to receipients
function sendEmailTo(recepient) {
// This function emulates sending emails to recipients
function sendEmailTo(recipient) {
// But really it only logs out a string
console.log("email sent to " + recepient);
console.log("email sent to " + recipient);
}
```
4 changes: 2 additions & 2 deletions legacy/javascript/javascript1/week3/homework.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ logOutNotesFormatted(); // should log out the text below

Suddenly you get this great idea for making the note app even better!

Come up with a unique feature **you think would make this app better.** Write down the idea and see if you can implement it. If not dont worry :) If it is too hard to implement try and ask in the slack channel :)
Come up with a unique feature **you think would make this app better.** Write down the idea and see if you can implement it. If not don't worry :) If it is too hard to implement try and ask in the slack channel :)

Try an **interactive version 💻 of your code** [here](https://codepen.io/dalsHughes/pen/poJGejX). Remember to insert your code in the top of the codepen :)

Expand Down Expand Up @@ -244,7 +244,7 @@ Come up with one feature you think would be helpful for this program.

Optional

- Lets improve the `addActivity`, so that we dont need to specify the date, but the function automatically figures out what the date is. Check out this link: <https://stackoverflow.com/a/34015511>
- Lets improve the `addActivity`, so that we don't need to specify the date, but the function automatically figures out what the date is. Check out this link: <https://stackoverflow.com/a/34015511>
- Improve the `showStatus` function by only showing the number of actitivies for that specific day.
- Create a function for calculating the activity a user has spent the most time on.

Expand Down
4 changes: 2 additions & 2 deletions legacy/javascript/javascript1/week3/lesson-plan.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Lesson plan

- Focus on having lots of in class exercises.
- DONT teach everything, let the students investigate topics on their own aswell!
- DON'T teach everything, let the students investigate topics on their own as well!
- Focus on how to read documentation, google answers and google errors!!
- Teach towards the students being able to solve the homework

Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you dont have access, write to one from the core team. You can see an example below!
Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below!

To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork)

Expand Down
8 changes: 4 additions & 4 deletions legacy/javascript/javascript1/week4/lesson-plan.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Lesson plan

- Focus on having lots of in class exercises.
- DONT teach everything, let the students investigate topics on their own aswell!
- DON'T teach everything, let the students investigate topics on their own as well!
- Focus on how to read documentation, google answers and google errors!!
- Teach towards the students being able to solve the homework

Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you dont have access, write to one from the core team. You can see an example below!
Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below!

To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork)

Expand Down Expand Up @@ -45,7 +45,7 @@ Focus on

### Fibonacci Sequence

Given a specific number in the fibonacci sequence return the fibonachi number.
Given a specific position in the Fibonacci sequence, return the Fibonacci number.

```js
// 0, 1, 1, 2, 3, 5, 8, 13, 21, 34
Expand Down Expand Up @@ -96,7 +96,7 @@ console.log(sentimentScoreObject);

### Credit card number formatter

This is a very real world example of a problem i got at my previous work. I was tasked to implement one of the smart credit card input fields, where the credit card numbers are seperated with a space. Fx inputting 123456789 would show 1234 5678 9.
This is a very real world example of a problem i got at my previous work. I was tasked to implement one of the smart credit card input fields, where the credit card numbers are separated with a space. Fx inputting 123456789 would show 1234 5678 9.

![Credit card formatter](assets/credit-card-formatter.gif)

Expand Down
6 changes: 3 additions & 3 deletions legacy/javascript/javascript2/week1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Or when someone clicks "Close cookies" (event) we want to remove the cookie div.

Lets first try to create some js that waits for 2 seconds and the console.logs out "2 seconds has elapsed!"

In JavaScript we use the word eventlistener to listen
In JavaScript we use an _event listener_ to listen:

```javascript
setTimeout(function () {
Expand All @@ -149,9 +149,9 @@ setTimeout(fourSecondLog, 4000);

Now lets try and log out "button clicked!" when a button is clicked.

To check if a button gets clicked we use a what is called an eventlistener.
To check if a button gets clicked we use a what is called an _event listener_.

Imagine a person listening to the click of a button and everytime he hears a click he yells out "CLICKED".
Imagine a person listening to the click of a button and every time he hears a click he yells out "CLICKED".

```javascript
const buttonElement = document.querySelector("button");
Expand Down
4 changes: 2 additions & 2 deletions legacy/javascript/javascript2/week1/lesson-plan.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Lesson plan

- Focus on having lots of in class exercises.
- DONT teach everything, let the students investigate topics on their own aswell!
- DON'T teach everything, let the students investigate topics on their own as well!
- Focus on how to read documentation, google answers and google errors!!
- Teach towards the students being able to solve the homework

Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you dont have access, write to one from the core team. You can see an example below!
Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below!

To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork)

Expand Down
2 changes: 1 addition & 1 deletion legacy/javascript/javascript2/week2/lesson-plan.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Lesson plan

- Focus on having lots of in class exercises.
- DONT teach everything, let the students investigate topics on their own aswell!
- DON'T teach everything, let the students investigate topics on their own as well!
- Focus on how to read documentation, google answers and google errors!!
- Teach towards the students being able to solve the homework

Expand Down
Loading