Skip to content

PAR John & Luca - #182

Closed
johndimitroff wants to merge 1 commit into
ironhack-labs:masterfrom
johndimitroff:master
Closed

PAR John & Luca#182
johndimitroff wants to merge 1 commit into
ironhack-labs:masterfrom
johndimitroff:master

Conversation

@johndimitroff

Copy link
Copy Markdown


//var hacker2 = prompt("What is your name?")
var hacker2 = "Luca"
console.log("The driver's name is " + hacker2);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can ask the user to enter a name himself by using "prompt" :
var hacker2 = prompt("What's your name ? ")

function isPalindrome(str){

// lower the case
var string = str.toLowerCase()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As a good practice, it is better not to call a variable my the name of a JS type name, you can use for intance "myString" instead of "string" :)

}

isPalindrome('a man, a plan, a canal, Panama!')
isPalindrome('john')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job ! Efficient, very clear and you take care of cleaning the string.
again you can check the prompt function to ask the user to enter an expression :)

@ta-web-paris

Copy link
Copy Markdown

Well done, great job! 💯

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