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 7 - Murat Demirtas - JavaScript-Core-1-Week 1 #37
Closed
Closed
Changes from all commits
Commits
Show all changes
4 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,4 @@ | ||
| console.log("Hello world"); | ||
| console.log(" Hello World. I just started learning JavaScript"); | ||
| console.log(" Hello World. I just started learning JavaScript"); | ||
| console.log(" Hello World. I just started learning JavaScript"); | ||
| console.log(5); |
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,6 @@ | ||
| // 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,7 @@ | ||
| // Start by creating a variable `message` | ||
|
|
||
| var message = "This is a string"; | ||
| var messageType = typeof message; | ||
|
|
||
| console.log(messageType); | ||
| 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,9 @@ | ||
| // Start by creating a variable `message` | ||
|
|
||
| console.log(message); | ||
| let message = "Hi everyone,nice to meet you, I am "; | ||
|
|
||
| let name = "Murat"; | ||
|
|
||
| let myMessage = message + name; | ||
|
|
||
| console.log(myMessage); |
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,14 @@ | ||
| // Start by creating a variable `message` | ||
| let message1 = "My name is "; | ||
|
|
||
| let message2 = " and my name is "; | ||
|
|
||
| let message3 = " characters long"; | ||
|
|
||
| let name = "Murat"; | ||
|
|
||
| let message = message1 + name + message2 + name.length + message3; | ||
|
|
||
| // below method seems easier | ||
| // let message = `My name is ${name} and my name is ${name.length} 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,8 @@ | ||
| const name = " Daniel "; | ||
| const name = " Murat "; | ||
|
|
||
| //assigning trimmed name to a new variable | ||
| let trimmedName = name.trim(); | ||
|
|
||
| let message = `My name is ${trimmedName} and my name is ${trimmedName.length} 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,13 @@ | ||
| // Start by creating a variables `numberOfStudents` and `numberOfMentors` | ||
|
|
||
| let numberOfStudents = 15; | ||
|
|
||
| let numberOfMentors = 8; | ||
|
|
||
| let totalNumbers = numberOfStudents + numberOfMentors; | ||
|
|
||
| console.log("Number of students: " + numberOfStudents); | ||
|
|
||
| console.log("Number of mentors: " + numberOfMentors); | ||
|
|
||
| console.log("Total number of students and mentors: " + totalNumbers); |
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,9 @@ | ||
| var numberOfStudents = 15; | ||
| var numberOfMentors = 8; | ||
|
|
||
| let perOfStudents = numberOfStudents / (numberOfStudents + numberOfMentors); | ||
| let perOfMentors = numberOfMentors / (numberOfMentors + numberOfStudents); | ||
|
|
||
| console.log(`Percentage students : ${Math.round(perOfStudents * 100)} %`); | ||
|
|
||
| console.log(`Percentage mentors : ${Math.round(perOfMentors * 100)} %`); |
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,7 +1,7 @@ | ||
| function halve(number) { | ||
| // complete the function here | ||
| return number / 2; | ||
| } | ||
|
|
||
| var result = halve(12); | ||
| var result = halve(20); | ||
|
|
||
| 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 |
|---|---|---|
| @@ -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,7 @@ | ||
| // Declare your function first | ||
| function divide(num1, num2) { | ||
| return num1 / num2; | ||
| } | ||
|
|
||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| // Write your function here | ||
| function createGreeting(name) { | ||
| return `Hello, my name is ${name}`; | ||
| } | ||
|
|
||
| var greeting = createGreeting("Daniel"); | ||
| var greeting = createGreeting("Murat"); | ||
|
|
||
| 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,9 @@ | ||
| // Declare your function first | ||
| function adder(num1, num2) { | ||
| return num1 + num2; | ||
| } | ||
|
|
||
| // Call the function and assign to a variable `sum` | ||
| let sum = adder(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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| // Declare your function here | ||
| function createLongGreeting(name, age) { | ||
| return `Hello, my name is ${name} and I'm ${age} years old`; | ||
| } | ||
|
|
||
| const greeting = createLongGreeting("Daniel", 30); | ||
| const greeting = createLongGreeting("Murat", 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
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.
Suggestion: You could do price * 0.9;
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.
Thank you Kara, you have spotted every detail.I appreciate your support.