Skip to content

[weptmad0418] - Georgina Pacey - #123

Closed
Georginapacey wants to merge 2 commits into
ironhack-labs:masterfrom
Georginapacey:master
Closed

[weptmad0418] - Georgina Pacey#123
Georginapacey wants to merge 2 commits into
ironhack-labs:masterfrom
Georginapacey:master

Conversation

@Georginapacey

Copy link
Copy Markdown

No description provided.

return hacker1Formatted;
}
formatHacker1();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lo has hecho bien, échale un ojo a las funciones split() y join() y cómo utilizarlas para este ejercicio, te ayudarán a resolverlo en menos líneas

}

reverseName(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.

Bien hecho!
Te comento como en la iteración anterior, échale un ojo a las funciones de antes y a la función reverse()


}
nameMatchCheckerEasy();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Genial, resulto fácil y sencillo.
Mira la función localeCompare(), es una función genial para resolver el ejercicio de manera muy rápida

//9. Palindrome
var userPalindrome = prompt("Type a palindrome");
//first remove spaces and punctiation, and convert to all same case to allow for palindromes like: Amor, Roma
var userFormattedPalindrome = userPalindrome.replace(/\W/g,"").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.

Evita usar por ahora expresiones regulares, cómo lo harías para evitar el uso de todos los caracteres que no sean letras minúsculas?

var userPalindrome = prompt("Type a palindrome");
//first remove spaces and punctiation, and convert to all same case to allow for palindromes like: Amor, Roma
var userFormattedPalindrome = userPalindrome.replace(/\W/g,"").toLowerCase();
var reverseWord = reverseName(userFormattedPalindrome);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reutilización 👍

} else {
console.log(userPalindrome + " is not a palindrome");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A lo mejor te gustan más los ternarios:
return userFormattedPalindrome === reverseWord ? true : false

countWords(loremIpsum);

function countSpecificWord(str) {
var wordMatchCount = str.match(/\bet\b/gi);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Como te comenté antes, en vez de expresiones regulares, intenta usar otra forma para resolver el problema, javascript te da una solución muy útil para resolver el problema. Échale un ojo a filter()

@ta-web-mad

Copy link
Copy Markdown

Buen punto que hayas empezado a implementar las funciones y a reutilizarlas cuando te podían hacer falta. Buen trabajo!

@stale

stale Bot commented Dec 17, 2019

Copy link
Copy Markdown

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 Dec 17, 2019
@stale

stale Bot commented Dec 19, 2019

Copy link
Copy Markdown

This pull request is closed. Thank you.

@stale stale Bot closed this Dec 19, 2019
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