BCN - Jack Watkins - #264
Closed
jackwatk wants to merge 1 commit into
Closed
Conversation
tawebbcn
reviewed
Oct 23, 2018
| @@ -1,7 +1,61 @@ | |||
| 'use strict'; | |||
tawebbcn
reviewed
Oct 23, 2018
| var hacker1 = "dave"; | ||
| console.log("the drivers name is " + hacker1); | ||
|
|
||
| let hacker2 = "hello"; |
Contributor
There was a problem hiding this comment.
Two things:
- try to keep your code consisten, you use everywhere var and here let...
- it isn't mandatory to declare the variable before and then change it. You can do :
var hacker2 = prompt('.....')
console.log('....' + hacker2)
tawebbcn
reviewed
Oct 23, 2018
| var driverNameStart = hacker1[0]; | ||
| var navigatorNameStart = hacker2[0]; | ||
| var alpha1 = alphabet.indexOf(driverNameStart); | ||
| var alpha2 = alphabet.indexOf(navigatorNameStart); |
Contributor
There was a problem hiding this comment.
you are not using this var, maybe you can get rid of those.
tawebbcn
reviewed
Oct 23, 2018
| console.log("Yo, the navigator goes first definitely"); | ||
| } else{ | ||
| console.log("What?! You both got the same name?"); | ||
| } |
Contributor
There was a problem hiding this comment.
You are not checking which hacker starts with the "smaller" letter. To do that you can use the variables that you created to check the first letter of each hacker and compare those.
if(driverNameStart > navigatorNameStart){
console.log("The driver's name goes first");
} ...
tawebbcn
reviewed
Oct 23, 2018
tawebbcn
left a comment
Contributor
There was a problem hiding this comment.
Nice work, keep like this. Only one thing: pay attention to identation!!
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.