[webptmad0418]Octavio#142
Conversation
ta-web-mad
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.