Skip to content

[webptmad0418]Octavio#142

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

[webptmad0418]Octavio#142
yotroz wants to merge 1 commit into
ironhack-labs:masterfrom
yotroz:master

Conversation

@yotroz
Copy link
Copy Markdown

@yotroz yotroz commented May 3, 2018

No description provided.

Copy link
Copy Markdown

@ta-web-mad ta-web-mad left a 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);

Copy link
Copy Markdown

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, "");

Copy link
Copy Markdown

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);

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, 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.

Copy link
Copy Markdown

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.

@stale
Copy link
Copy Markdown

stale Bot commented Dec 17, 2019

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
Copy link
Copy Markdown

stale Bot commented Dec 19, 2019

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