-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[webptmad0418]Octavio #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dale una vuelta a lo que te he puesto e intenta repetir lo que haces con expresiones regulares sin ellas. Ánimo!
var reverseHacker2 = hacker2.split('').reverse().join(''); | ||
|
||
console.log(reverseHacker2); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ambas son correctas, pero dime, cómo lo harías sin utilizar split( ), join( ) y reverse( )?
|
||
|
||
var isItPalindrome = prompt("Try to write a palindrome, brah").toLowerCase().replace(/\s/g, '').replace(/[',.'"?]/g, ""); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No me vale, te diría que no a un solo replace( ), con lo que dos no puede ser. Inténtalo sin usar expresiones regulares
console.log(loremIpsum.split(" ").length); | ||
|
||
var count = loremIpsum.match(/\bet\b/g); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Como te comenté antes, inténtalo sin expresiones regulares. Javascript provée de métodos tremendamente útiles
var count = loremIpsum.match(/\bet\b/g); | ||
|
||
count = count? count.length : 0; //checking if there are matches or not. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esta evaluación es innecesaria. Si usas alguno de los métodos de javascript no te hace falta.
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. |
This pull request is closed. Thank you. |
No description provided.