This repository was archived by the owner on Jan 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 476
WM4 - Abdirahim Hussein - JavaScript-Core-1-Coursework-Week-1 #467
Open
12shussein
wants to merge
2
commits into
CodeYourFuture:master
Choose a base branch
from
12shussein:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| console.log("Hello world"); | ||
| console.log("this is my introduction to javascript") | ||
| console.log("by the end of javascript i will be experience in this programming language") | ||
|
|
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // Start by creating a variable `greeting` | ||
| let greeting ="Hello world"; | ||
| console.log(greeting); | ||
| console.log(greeting); | ||
| console.log(greeting); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // Start by creating a variable `message` | ||
| let message = "This is a string"; | ||
| let messageExample = typeof message; | ||
|
|
||
|
|
||
| console.log(message); | ||
| console.log(messageExample); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // Start by creating a variable `message` | ||
| let greeting = "Hello, my name is "; | ||
| let name = "Abdirahim"; | ||
|
|
||
| let greetingOutput = greeting + name; | ||
|
|
||
| console.log(greetingOutput); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // Start by creating a variable `message` | ||
|
|
||
| let text = "Abdirahim" | ||
| let nameLength = text.length | ||
| let message = `My name is ${text} and my name is ${nameLength} characters long` | ||
| console.log(message); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| const text = " Abdirahim "; | ||
| const nameLength = text.trim(); | ||
| console.log(); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| // Start by creating a variables `numberOfStudents` and `numberOfMentors` | ||
| let numberOfStudents: 15; | ||
| let numberOfMentors: 8; | ||
| let numberOfStudentsAndMentors: 23; | ||
| numberOfStudentsAndMentors = numberOfStudents + numberOfMentors; | ||
| let message = `Total number of students and mentors: ${numberOfStudentsAndMentors}`; | ||
| console.log(message); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
|
|
||
| var numberOfStudentsAndMentors = numberOfStudents + numberOfStudents; | ||
| var percentageOfStudents = numberOfStudents / numberOfStudentsAndMentors * 100; | ||
| var percentageOfMentors = numberOfMentors / numberOfStudentsAndMentors * 100; | ||
|
|
||
| console.log(`Percentage of students: ${Math.round(percentageOfStudents)}` + "%"); | ||
| console.log(`Percentage of mentors: ${Math.round(percentageOfMentors)}` + "%"); |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
exercises/J-functions/exercise.js → .github/exercises/J-functions/exercise.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| function halve(number) { | ||
| // complete the function here | ||
| return number / 2; | ||
| } | ||
|
|
||
| var result = halve(12); | ||
|
|
||
1 change: 1 addition & 0 deletions
1
exercises/J-functions/exercise2.js → .github/exercises/J-functions/exercise2.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| function triple(number) { | ||
| // complete function here | ||
| return number * 3; | ||
| } | ||
|
|
||
| var result = triple(12); | ||
|
|
||
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
exercises/K-functions-parameters/exercise.js → ...rcises/K-functions-parameters/exercise.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...cises/K-functions-parameters/exercise2.js → ...cises/K-functions-parameters/exercise2.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| // Declare your function first | ||
|
|
||
| function divide(a, b){ | ||
| return a / b; | ||
| } | ||
| var result = divide(3, 4); | ||
|
|
||
| console.log(result); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Write your function here | ||
| function createGreeting(name){ | ||
| return name; | ||
| } | ||
|
|
||
| var greeting = createGreeting("Daniel"); | ||
|
|
||
| console.log(`Hello, nice to meet you my name is $(greeting)`); | ||
6 changes: 4 additions & 2 deletions
6
...cises/K-functions-parameters/exercise4.js → ...cises/K-functions-parameters/exercise4.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| // Declare your function first | ||
|
|
||
| function total(a, b){ | ||
| return a + b; | ||
| } | ||
| // Call the function and assign to a variable `sum` | ||
|
|
||
| const sum = total(102, 79); | ||
| console.log(sum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // Declare your function here | ||
| function createLongGreeting(name,age){ | ||
| return `Hello my name is ${name} and I am ${age} years old.`; | ||
| } | ||
| const greeting = createLongGreeting("Daniel", 30); | ||
| console.log(greeting); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| function mentorName(name) { | ||
| return name.toUpperCase(); | ||
| } | ||
| function shoutyGreeting(name) { | ||
| var name = mentorName(name); | ||
| var message = `HELLO ${name}`; | ||
| return message; | ||
| } | ||
|
|
||
| var mentor1 = "Daniel"; | ||
| var mentor2 = "Irina"; | ||
| var mentor3 = "Mimi"; | ||
| var mentor4 = "Rob"; | ||
| var mentor5 = "Yohannes"; | ||
|
|
||
|
|
||
| console.log(message(mentor1)); | ||
| console.log(message(mentor2)); | ||
| console.log(message(mentor3)); | ||
| console.log(message(mentor4)); | ||
| console.log(message(mentor5)); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, please see the example above, your variable will contain the callback function and there we assign the name, so your return must contain the rest of the sentence in string and then you can make the interpolation. I hope this helps to you.☺️