Skip to content

[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

Closed
wants to merge 1 commit into from
Closed

[webptmad0418]Octavio #142

wants to merge 1 commit into from

Conversation

yotroz
Copy link

@yotroz yotroz commented May 3, 2018

No description provided.

Copy link

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

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

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

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.

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

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

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy