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 - Kerim Zamir - JS - Week 1 #320
Closed
Closed
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
dc7193f
Update exercise.js
Arbeits-Sachen a2eae5b
Update exercise.js
Arbeits-Sachen a495323
Update exercise.js
Arbeits-Sachen 81106b2
Update exercise.js
Arbeits-Sachen dada915
Update exercise.js
Arbeits-Sachen f0338ac
Update exercise.js
Arbeits-Sachen 6e45950
Update exercise.js
Arbeits-Sachen 8a6b13b
Update exercise2.js
Arbeits-Sachen 913a95e
Update exercise.js
Arbeits-Sachen afb10dd
Update exercise.js
Arbeits-Sachen 72e7c00
Update exercise.js
Arbeits-Sachen eaf2053
Update exercise.js
Arbeits-Sachen cb0dbc3
Update exercise2.js
Arbeits-Sachen 0c0e2ec
Update exercise.js
Arbeits-Sachen 7237b2a
Update exercise2.js
Arbeits-Sachen 9048add
Update exercise3.js
Arbeits-Sachen 7218789
Update exercise4.js
Arbeits-Sachen f8ed4c4
Update exercise5.js
Arbeits-Sachen 0178210
Update exercise.js
Arbeits-Sachen 38ad5af
Update exercise.js
Arbeits-Sachen 983d150
Update exercise.js
Arbeits-Sachen df8e91f
Update exercise.js
Arbeits-Sachen 2b78de9
Update exercise.js
Arbeits-Sachen d51c358
Update exercise.js
Arbeits-Sachen 7868546
Update exercise2.js
Arbeits-Sachen 1b0e2a2
Update exercise.js
Arbeits-Sachen 8e9f296
Update exercise.js
Arbeits-Sachen 2f0d2d5
Update 1-syntax-errors.js
Arbeits-Sachen 2cca2ed
Update 2-logic-error.js
Arbeits-Sachen fcdf0e0
Update 3-function-output.js
Arbeits-Sachen 73cd80b
Update 4-tax.js
Arbeits-Sachen 21994c5
Update 1-syntax-errors.js
Arbeits-Sachen 2e87b25
Update 1-currency-conversion.js
Arbeits-Sachen 6ef51da
Update 1-currency-conversion.js
Arbeits-Sachen 07bf0c6
Update 2-piping.js
Arbeits-Sachen 1a8f695
Update 2-piping.js
Arbeits-Sachen ba49a1f
Update 2-piping.js
Arbeits-Sachen 463a884
Update exercise.js
Arbeits-Sachen 48563e3
Update 2-piping.js
Arbeits-Sachen 8fc1b5d
Update 1-currency-conversion.js
Arbeits-Sachen 9ea1621
Update 1-currency-conversion.js
Arbeits-Sachen b6c273d
Update 1-currency-conversion.js
Arbeits-Sachen 053c919
Update 3-magic-8-ball.js
Arbeits-Sachen 374c373
Update 3-magic-8-ball.js
Arbeits-Sachen 46d6d39
Update 3-magic-8-ball.js
Arbeits-Sachen 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 @@ | ||
| console.log("Hello world"); | ||
| console.log("Hello World. I just started learning JavaScript!"); |
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,5 @@ | ||
| // Start by creating a variable `greeting` | ||
| var greeting = "Hello world"; | ||
|
|
||
| console.log(greeting); | ||
| console.log(greeting); | ||
| 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,5 @@ | ||
| // Start by creating a variable `message` | ||
| var message = "This is a string"; | ||
| var messageType = typeof message; | ||
|
|
||
| console.log(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,5 @@ | ||
| // Start by creating a variable `message` | ||
| var greetingStart = "Hello, my name is "; | ||
| var name = "Daniel"; | ||
| var greeting = greetingStart + name; | ||
|
|
||
| console.log(message); | ||
| 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,5 @@ | ||
| // Start by creating a variable `message` | ||
| var name = "Daniel"; | ||
| var nameLength = name.length; | ||
| var message = "My name is " + name + " 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 |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| const name = " Daniel "; | ||
| const name = "Daniel ".trim(); | ||
| var nameLength = name.length; | ||
| var message = "My name is " + name + " 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 |
|---|---|---|
| @@ -1 +1,8 @@ | ||
| // Start by creating a variables `numberOfStudents` and `numberOfMentors` | ||
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
|
|
||
| var total = numberOfStudents + numberOfMentors; | ||
|
|
||
| console.log("Number of students: " + numberOfStudents) | ||
| console.log("Number of mentors: " + numberOfMentors) | ||
| console.log("Total numnber of students and mentors: " + total); |
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,12 @@ | ||
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
|
|
||
| var total = numberOfStudents + numberOfMentors; | ||
|
|
||
| var percent = 100 / total; | ||
|
|
||
| var numberOfStudentsPercent = Math.round(percent * numberOfStudents); | ||
| var numberOfMentorsPercent = Math.round(percent * numberOfMentors); | ||
|
|
||
| console.log("Number of students: " + numberOfStudentsPercent + "%") | ||
| console.log("Number of mentors: " + numberOfMentorsPercent + "%") |
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 |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| // Complete the function so that it takes input parameters | ||
| function multiply() { | ||
| // Calculate the result of the function and return it | ||
| function multiply(number1, number2) | ||
| { | ||
| return number1 * number2; | ||
| } | ||
|
|
||
| // Assign the result of calling the function the variable `result` | ||
| var result = multiply(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
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 @@ | ||
| // Write your function here | ||
|
|
||
| function createGreeting(name) | ||
| { | ||
| return "Hello, my name is " + name; | ||
| } | ||
| var greeting = createGreeting("Daniel"); | ||
|
|
||
| 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,5 +1,7 @@ | ||
| // Declare your function first | ||
|
|
||
| // Call the function and assign to a variable `sum` | ||
| function add(num1, num2) | ||
| { | ||
| return num1 + num2; | ||
| } | ||
| var sum = add(13, 124); | ||
|
|
||
| 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
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
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,16 +1,20 @@ | ||||||
| // Add comments to explain what this function does. You're meant to use Google! | ||||||
| function getRandomNumber() { | ||||||
| return Math.random() * 10; | ||||||
| function getRandomNumber() | ||||||
| { | ||||||
| //This function gets a random number between 0 and 1 and returns the result after multiplying the random number and the 10. | ||||||
|
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.
Suggested change
|
||||||
| return Math.random() * 10; | ||||||
| } | ||||||
|
|
||||||
| // Add comments to explain what this function does. You're meant to use Google! | ||||||
| function combine2Words(word1, word2) { | ||||||
| return word1.concat(word2); | ||||||
|
|
||||||
| // Add comments to explain what this function does. You're meant to use Google! | ||||||
| function combine2Words(word1, word2) | ||||||
| { | ||||||
| //This function joins the two words together and then its returns the value. | ||||||
| return word1.concat(word2); | ||||||
| } | ||||||
|
|
||||||
| 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. | ||||||
| function concatenate(firstWord, secondWord, thirdWord) | ||||||
| { | ||||||
| return firstWord.concat(" ", secondWord, " ", thirdWord); | ||||||
| } | ||||||
|
|
||||||
| /* | ||||||
|
|
||||||
Oops, something went wrong.
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.
another option
const result = format(multiply(add(startingValue, 10), 2))