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 475
London Class_9-Sahar Naderi - JavaScript-Core-1-Coursework-Week1 #470
Open
SaharNaderi
wants to merge
2
commits into
CodeYourFuture:master
Choose a base branch
from
SaharNaderi: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
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 +1,19 @@ | ||
| console.log("Hello world"); | ||
| console.log("Hello world"); | ||
| console.log("Sahar") | ||
| console.log("12") | ||
| console.log(sahar); | ||
| console.log("sahar"); | ||
| console.log("nad"); | ||
| console.log("Hello world"); | ||
| console.log("1111111"); | ||
| var greeting = "Hello world"; | ||
| console.log(greeting); | ||
| var greeting = "Hello world"; | ||
|
|
||
| console.log(greeting); | ||
|
|
||
| var greeting = "Hello world"; | ||
|
|
||
| console.log(greeting); | ||
|
|
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,3 +1,13 @@ | ||
| // Start by creating a variable `greeting` | ||
| var greeting = "Hello world"; | ||
|
|
||
| console.log(greeting); | ||
| var greeting = "Hello world"; | ||
|
|
||
| console.log(greeting); | ||
| var greeting = "Hello world"; | ||
|
|
||
| console.log(greeting); | ||
|
|
||
|
|
||
|
|
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,3 +1,9 @@ | ||
| // Start by creating a variable `message` | ||
|
|
||
| var message = "This is a string"; | ||
| console.log(message); | ||
| var messageType = typeof message; | ||
|
|
||
| console.log(messageType); | ||
|
|
||
|
|
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,3 +1,8 @@ | ||
| // Start by creating a variable `message` | ||
|
|
||
| console.log(message); | ||
| var greetingStar = "Hello my name is "; | ||
| var name = "Sahar"; | ||
|
|
||
| var greeting = greetingStar+ name ; | ||
| console.log(greeting); | ||
|
|
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,3 +1,10 @@ | ||
| // Start by creating a variable `message` | ||
|
|
||
| console.log(message); | ||
| var phraseStart = "My name is Sahar and my name is "; | ||
| var name = "Sahar"; | ||
| var phraseLenght = name.length; | ||
| var restPhrase = " characters long" | ||
| var phrase = phraseStart + phraseLenght + restPhrase ; | ||
| console.log(phrase); | ||
|
|
||
|
|
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,3 +1,10 @@ | ||
| const name = " Daniel "; | ||
| var phraseStart = " My name is Sahar and my name is "; | ||
| var name = "Sahar"; | ||
| var phraseLenght = name.length; | ||
| var restPhrase = " "+"characters long. " | ||
| var phrase = " "+ phraseLenght + restPhrase ; | ||
| var result = phraseStart.trim() + phrase; | ||
|
|
||
| console.log(result); | ||
|
|
||
|
|
||
| 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 |
|---|---|---|
| @@ -1 +1,9 @@ | ||
| // Start by creating a variables `numberOfStudents` and `numberOfMentors` | ||
| var numberOfStudents = 15; | ||
| console.log(numberOfStudents); | ||
|
|
||
| var numberOfMentors = 8 ; | ||
| console.log(numberOfMentors); | ||
|
|
||
| var sum = numberOfStudents + numberOfMentors ; | ||
| 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 |
|---|---|---|
| @@ -1,2 +1,10 @@ | ||
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
|
|
||
| var total = numberOfMentors + numberOfStudents; | ||
|
|
||
| var percentageOfStudents = (numberOfStudents*100)/total; | ||
| var percentageOfMentors =(numberOfMentors*100)/total; | ||
|
|
||
| console.log(`Precentage students : ${Math.round(percentageOfStudents)}%`); | ||
| console.log(`Precentage mentors : ${Math.round(percentageOfMentors)}%`); |
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); | ||
|
|
||
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,5 @@ | ||
| function triple(number) { | ||
| // complete function here | ||
| return number * 3 ; | ||
| } | ||
|
|
||
| var result = triple(12); | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| // Declare your function first | ||
| function divide (a,b){ | ||
| return a / b ; | ||
| } | ||
|
|
||
| var result = divide(3, 4); | ||
|
|
||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| // Declare your function first | ||
| function add (a,b) { | ||
| return a+b ; | ||
|
|
||
| // Call the function and assign to a variable `sum` | ||
|
|
||
| } | ||
|
|
||
| var sum = add(124,13); | ||
|
|
||
| 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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| // Declare your function here | ||
|
|
||
| function createLongGreeting (a,b){ | ||
| return "Hello,my name is "+ a + "and I am "+ b + " years old"; | ||
| } | ||
| const greeting = createLongGreeting("Daniel", 30); | ||
|
|
||
| console.log(greeting); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,13 @@ function getRandomNumber() { | |
|
|
||
| // Add comments to explain what this function does. You're meant to use Google! | ||
| function combine2Words(word1, word2) { | ||
| return word1.concat(word2); | ||
| return word1.concat("",word2); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The concat change here with the double quotes "" is not necessary. Only thing required in this part is adding a comment line above combine2Words |
||
| } | ||
|
|
||
| function concatenate(firstWord, secondWord, thirdWord) { | ||
| // Write the body of this function to concatenate three words together. | ||
| // Look at the test case below to understand what this function is expected to return. | ||
| return firstWord.concat(" ",secondWord," ",thirdWord) | ||
| } | ||
|
|
||
| /* | ||
|
|
||
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, I believe you are supposed to write your own comment here to describe what this function does.