Skip to content

MIA full time web dev - #190

Closed
yonathanh wants to merge 2 commits into
ironhack-labs:masterfrom
yonathanh:master
Closed

MIA full time web dev#190
yonathanh wants to merge 2 commits into
ironhack-labs:masterfrom
yonathanh:master

Conversation

@yonathanh

Copy link
Copy Markdown

No description provided.

// Lorem ipsum generator
console.log("Driver's name");
for (let i = 0; i < hacker1.length; i++) {
console.log(hacker1[i].toUpperCase());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should make an empty space between each letter.


console.log("Nav's name");
for (let i = hacker2.length - 1; i >= 0; i--) {
console.log(hacker2[i]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is printing all the letters in the backward order, but also you need to put it back to the string.

console.log(hacker2[i]);
}

if (hacker1 < hacker2) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To sort the strings alphabetically, try using .localeCompare() or some other sorting method.

let palindrom = prompt("input a word to test for palindrom", "harry potter");

function checkPalindrom(palindrom) {
for (let i = 0, j = palindrom.length; i < palindrom.length; i++, j--) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is failing but if you make a small update where you assign value to the j it will work:

for (let i = 0, j = palindrom.length-1; i < palindrom.length; i++, j--) {
	// code goes here
}

@sandrabosk

Copy link
Copy Markdown
Contributor

Good work. Keep it like this. Thank you for submitting.

@sandrabosk sandrabosk closed this Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants