-
Notifications
You must be signed in to change notification settings - Fork 10
Week6 homework #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Week6 homework #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
|
|
||
| // Q1 | ||
| //console.log('Hello world!'); | ||
| //console.log('!مرحبا بالعالم'); | ||
| //console.log('Saluton mondo'); | ||
| //console.log('Hej världen!'); | ||
| //console.log('Selam Dünya!'); | ||
| //console.log('ہیلو ورلڈ!'); | ||
| //console.log('Aloha kākou honua!'); | ||
|
|
||
| //Q2 | ||
| //console.log('Im awesome'); | ||
|
|
||
|
|
||
| /* | ||
| //Q3 | ||
| let age; | ||
| console.log ('You still Young, your age is:'); | ||
|
Collaborator
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. 😄 |
||
| age = 33; | ||
| console.log (age); | ||
| console.log ('your age is '+age+' years, 5 month, 11 days '); | ||
| */ | ||
|
|
||
|
|
||
| //Q4 | ||
| /* | ||
| var definition; | ||
| definition = ('a method to determines whether a string contains the characters of a specified string'); | ||
| console.log(definition); | ||
| definition = ('This method returns true if the string contains the characters, and false if not.'); | ||
| console.log(definition); | ||
| */ | ||
|
|
||
|
|
||
| //Q5 | ||
| /* | ||
| let exchangeRate; | ||
| exchangeRate = 7.25 | ||
| console.log(exchangeRate); | ||
| var roundNumber | ||
| roundNumber = Math.round(exchangeRate); | ||
| console.log(roundNumber); | ||
| var hightNumber | ||
| hightNumber = Math.max(exchangeRate, roundNumber); | ||
| */ | ||
|
|
||
|
|
||
|
|
||
|
|
||
| //Q6 | ||
| /* | ||
| var petStore = (''); | ||
|
Collaborator
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. An array uses square brackets. Declaring an empty array would be this: var petStore = []; |
||
| console.log(petStore); | ||
| console.log('The Array above is undefined') | ||
|
|
||
| var preditors = ["Tigers", "Lions", "Bears"]; | ||
| console.log(preditors); | ||
| preditors.push ("Wolves"); | ||
| console.log(preditors); | ||
| */ | ||
|
|
||
| //Q7 | ||
| /* | ||
| let myString | ||
| myString = ("this is a test") | ||
| var L= myString.length; | ||
| console.log(L) | ||
| */ | ||
|
|
||
|
|
||
| //Q8 | ||
| /*let x = 7 | ||
| x = x%3 | ||
| console.log(x) | ||
| */ | ||
|
|
||
|
|
||
|
|
||
| //Q9 | ||
|
|
||
| /*var activities = [['Work', 8], ['Eat', 2], ['workout', 2], ['Play Game', 2], ['Sleep', 7]]; | ||
| console.log(activities); | ||
|
|
||
| if (6/0 === 10/0) { | ||
| console.log("Let's call it Infinity!")};*/ | ||
|
|
||
|
|
||
|
|
||
| //Q10 | ||
| /* | ||
| const grid = [[0, 1], [1, 1], [2, 1], [3, 1]]; | ||
| console.log(grid[2]); | ||
| */ | ||
|
|
||
|
|
||
| //Q11 | ||
| /* | ||
| let counter = 0; | ||
| console.log(counter); | ||
|
|
||
| counter = counter + 2; | ||
| console.log(counter + '/First Method'); | ||
|
|
||
| counter = counter ++; | ||
| console.log(counter + '/Second Method'); | ||
|
|
||
| console.log(counter++ + '/third Method'); | ||
| */ | ||
|
|
||
|
|
||
|
|
||
| //Q12 | ||
| /* | ||
| const Ash = { | ||
| name: 'Thomas', | ||
| age: 1, | ||
| color: 'orange', | ||
| bestFriend: 'OLE', | ||
| favoriteFood : 'wet Food' | ||
| } | ||
| conole.log (Ash); | ||
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.
We should still keep the quote in the string!
You can escape the quote like this:
Or use double quotes for your outer quotes like this: