-
Notifications
You must be signed in to change notification settings - Fork 5.9k
PP-WDFT-MEX-ARTURO-ARAUJO-ADRIAN-ACEVEDO #628
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,54 @@ | ||
| // Iteration 1: Names and Input | ||
| const hacker1 = 'adrian' | ||
| const hacker2 = 'juan' | ||
|
|
||
| console.log('The driver name is ' + hacker1) | ||
| console.log('The navigator name is ' + hacker2) | ||
|
|
||
|
|
||
| // Iteration 2: Conditionals | ||
| if(hacker1.length > hacker2.length){ | ||
| console.log('The driver has the longest name, it has ' + hacker1.length + ' characters.') | ||
| } else if(hacker1.length < hacker2.length){ | ||
| console.log('It seems that the navigator has the longest name, it has ' + hacker2.length + ' characters.') | ||
| } else { | ||
| console.log('Wow, you both have equially long names, ' + hacker1.length + ' characters.') | ||
| } | ||
|
|
||
| let capital = hacker1.toUpperCase() | ||
| let space = capital.split("").join(" ") | ||
| //.join es para unir y en los parentesis va la condicion | ||
| console.log(space) | ||
|
|
||
| console.log(hacker2.split("").reverse().join("")) | ||
|
|
||
| let compare = hacker2.localeCompare(hacker1) | ||
|
|
||
|
|
||
| // Iteration 3: Loops | ||
| if (compare === 1){ | ||
| console.log('The drivers name goes first') | ||
| } else if (compare === -1){ | ||
| console.log('Yo, the navigator goes first definitely') | ||
| } else{ | ||
| console.log('What?! You both have the same name') | ||
| } | ||
|
|
||
| //bonus | ||
|
|
||
| const text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris augue leo, finibus et augue sed, facilisis faucibus arcu. Nunc sodales ornare arcu, et interdum nulla hendrerit ut. Nullam finibus metus metus, vel blandit tellus interdum eu. Integer laoreet malesuada maximus. Nulla nec orci vestibulum odio mattis imperdiet eu vitae orci. Proin gravida tempor nisl at accumsan. Curabitur auctor gravida diam. Ut cursus tempus pretium. Integer ac tortor a tortor laoreet tempor sed varius enim. Suspendisse volutpat dignissim ante, ac pulvinar mauris gravida ut. In neque leo, sagittis et nibh sit amet, porttitor tincidunt nunc. Cras non sollicitudin justo, sit amet consectetur nunc. Nullam eu dolor ex. Phasellus in nibh urna. Quisque blandit aliquam felis, eu ultrices nibh mollis nec. Suspendisse pulvinar lobortis ipsum, quis blandit elit lacinia sit amet. Vivamus consequat accumsan pulvinar. Aenean leo felis, auctor in erat vel, cursus tristique libero. Nam finibus porta eros, id blandit erat posuere sit amet. Proin accumsan magna vitae enim mollis finibus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus mollis tellus lectus, eu porttitor neque imperdiet eu. Vestibulum nec sapien eu lectus vehicula bibendum ut eget odio. Etiam lorem velit, varius nec porttitor ac, consectetur eget diam. Interdum et malesuada fames ac ante ipsum primis in faucibus. Integer eget quam ipsum. Aenean posuere ligula at maximus lacinia. Nulla faucibus, ligula id ultrices eleifend, elit sem feugiat mauris, eget tincidunt odio enim sit amet erat. Quisque elementum ut nisl a laoreet. Donec elit lacus, euismod a neque in, finibus sodales dui. Aenean vitae nunc mollis, tincidunt lectus eget, bibendum nulla. Vestibulum euismod interdum urna, vel rhoncus massa elementum non. Suspendisse maximus elit vel orci ultricies consectetur. Praesent eu imperdiet nunc. Pellentesque a odio massa. Praesent pretium leo sed fringilla interdum. Vestibulum eu tempor diam. Curabitur vel elit venenatis, congue tortor a, mattis sem. Etiam laoreet justo a est fringilla, eget congue dui pretium. Nam condimentum convallis massa non interdum et." | ||
|
|
||
| const spaceWorl = text.split(" ") | ||
| const numberWorl = spaceWorl.length | ||
| console.log(numberWorl) | ||
|
|
||
| let counter = 0 | ||
|
|
||
| for (let i = 0; i <= spaceWorl.length; i++){ | ||
| if(spaceWorl[i] = 'et'){ | ||
| counter = counter + 1 | ||
| } | ||
| } | ||
|
|
||
| // Iteration 3: Loops | ||
|
|
||
| console.log(counter) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Necesitas doble o triple igualdad para que tu condicional funcione. Se recomienda triple igualdad porque conoces el tipo de dato que viene y sabes que tiene que ser el mismo que
"et".