Skip to content

LIS - WDPT - FEB - WILSON CRUZ#745

Closed
galatoide wants to merge 6 commits into
ironhack-labs:masterfrom
galatoide:master
Closed

LIS - WDPT - FEB - WILSON CRUZ#745
galatoide wants to merge 6 commits into
ironhack-labs:masterfrom
galatoide:master

Conversation

@galatoide
Copy link
Copy Markdown

@ironhack-LIS-PTWD
Copy link
Copy Markdown

ironhack-LIS-PTWD commented Feb 12, 2020

Hi Wilson,
really well done!
In iteration 3.3 the lab wants you to sort the name by alphabetical order. I would recommend you to use the method .localeCompare() check out how to use it here

For the last 2. Bonus have a look at this solution:

//change around phraseToCheck to text results
const phraseToCheck = "Amor, Roma";

// 1st Remove spaces from String
let removedSpaces = "";
for(i= 0; i < phraseToCheck.length; i++){
  if(phraseToCheck[i] === " "){
    continue
  } else {
    removedSpaces += phraseToCheck[i].toLowerCase()
  }
}
// 2nd compare every index from front with every index from end
let output = ""
for(i = 0; i < removedSpaces.length; i++) {
  if(removedSpaces[i] === removedSpaces[removedSpaces.length-1-i]) {
    output = `${phraseToCheck} is a Palindrome. :) `
  } else {
    output = `${phraseToCheck} is not a Palindrome. :( `
    break }
}
console.log("Bonus 2: ",output)

Hope this helps :)
Paula

@stale
Copy link
Copy Markdown

stale Bot commented Mar 13, 2020

This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Mar 13, 2020
@stale
Copy link
Copy Markdown

stale Bot commented Mar 15, 2020

This pull request is closed. Thank you.

@stale stale Bot closed this Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants