This repository was archived by the owner on May 14, 2024. It is now read-only.
Repository navigation
add homework for week1 js #205
Closed
Closed
Changes from 1 commit
Commits
Show all changes
5 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
add changes, till step 8
- Loading branch information
commit c8392a00ebac1d3daed902e754e1c5ed982953b2
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,7 +1,7 @@ | ||
| var myString="hello"+ " "+ "world"; | ||
| console.log('greetings'); | ||
| let myString="Enwer Memet"; | ||
| console.log(`my fullname`); | ||
| console.log(myString); | ||
|
|
||
| var myString="love you"; | ||
| myString="love you"; | ||
| console.log('love'); | ||
| console.log(myString); |
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,11 @@ | ||
| var animals=[]; | ||
| console.log('names of animals'); | ||
| console.log(`an empty array`); | ||
| console.log(animals); | ||
| var newLength = animals.push('wolf');//it does not work here. | ||
|
|
||
| var myPets = ["cat", "horse", "sheep"]; | ||
| console.log(myPets); | ||
| // var newLength = myPets.push('wolf');//it works here. | ||
|
|
||
|
|
||
| myPets.push('Piglet'); | ||
| console.log(myPets); | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -3,6 +3,6 @@ var mySentence ="Programming is so interesting!"; | |
| var length=mySentence.length; | ||
|
Contributor
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. Same question here, is it better to use |
||
| console.log(length); | ||
|
|
||
| // or | ||
| // console.log(mySentence.length); | ||
|
|
||
| // document.write(mySentence.length); | ||
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,9 @@ | ||
| 'use strict'; | ||
| let numberX; | ||
| console.log('number'); | ||
| console.log(12); | ||
| let x; | ||
| console.log('I think the value of x is undifined '); | ||
| console.log(x); | ||
|
|
||
| // | ||
| var numberX = 12; | ||
| console.log('month'); | ||
| console.log(12); | ||
| x = 12; | ||
| console.log(`i think it's an integer, its value is 12`); | ||
| console.log(x); |
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,52 @@ | ||
| 'use strict' | ||
| let fruit='apple'; | ||
| let user='enwer'; | ||
| const car = { type: "Fiat", model: "500", color: "white" }; | ||
| const team = { type: "lakers", model: "1990", color: "yellow" }; | ||
|
|
||
| var fruit='apple'; | ||
| var fruit='pear'; | ||
| var car = { type: "Fiat", model: "500", color: "white" }; | ||
| if (typeof fruit === typeof user) { | ||
| console.log('fruit and user : SAME TYPE') | ||
| } | ||
| else { | ||
| console.log('fruit and user: Not the same...') | ||
| } | ||
|
|
||
|
|
||
| if (typeof fruit === typeof car) { | ||
| console.log('fruit and car : SAME TYPE') | ||
| } | ||
| else { | ||
| console.log('fruit and car: Not the same...') | ||
| } | ||
|
|
||
|
|
||
| if (typeof fruit === typeof team) { | ||
| console.log('fruit and team : SAME TYPE') | ||
| } | ||
| else { | ||
| console.log('fruit and team: Not the same...') | ||
| } | ||
|
|
||
|
|
||
| if (typeof fruit === typeof user) { | ||
| console.log('fruit and user : SAME TYPE') | ||
| } | ||
| else { | ||
| console.log('fruit and user: Not the same...') | ||
| } | ||
|
|
||
|
|
||
| if (typeof team === typeof user) { | ||
| console.log('team and user : SAME TYPE') | ||
| } | ||
| else { | ||
| console.log('team and user: Not the same...') | ||
| } | ||
|
|
||
|
|
||
| if (typeof car === typeof team) { | ||
| console.log('car and team : SAME TYPE') | ||
| } | ||
| else { | ||
| console.log('car and team: Not the same...') | ||
| } |
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.
I would use
lethere:)