Skip to content

Conversation

ParinaKh
Copy link

Hi,

could you confirm everything works?

Thanks


// Iteration 2: Conditionals

function theLongestName(name) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful with the parameters, but I guess that now you understood ;)

if (hacker1.length > hacker2.length) {
return "The Driver has the longest name, it has " + hacker1.length + " characters"
} else if (hacker1.length < hacker2.length) {
return "Yo, navigator got the longest name, it has " + hacker2.length + " characters"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are only comparing the first letter and not the whole word, use a loop instead to parse each letter of the word!

function reverseString(str) {
let upperCasedFirstLetter = hacker2.slice(0, 1).toUpperCase();
console.log(upperCasedFirstLetter)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your 2 first variable are useless... you are not calling them later.
But good job for the revers + join !

var alphaName = array1.sort();
if (hacker1.slice(0, 1) < hacker2.slice(0, 1)) {
return "The driver's name goes first."
} else if (hacker1.slice(0, 1) > hacker2.slice(0, 1)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment for the parameters...

if (input == null || input.length == 0) {
return 0;
}
var words = input.split(" ");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job, super efficient!

@ta-web-paris
Copy link

Follow my advices and next time it would be perfect ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy