Skip to content

[ING-FT-112019]-Kai and Tomasz - #579

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

[ING-FT-112019]-Kai and Tomasz#579
zahnk wants to merge 2 commits into
ironhack-labs:masterfrom
zahnk:master

Conversation

@zahnk

@zahnk zahnk commented Nov 18, 2019

Copy link
Copy Markdown

No description provided.

Comment thread js/index.js
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

prefer an explicit condition like " === "

Comment thread js/index.js
let str = "";

for (let i = 0; i < hacker1.length; i++) {
str = str + hacker1.charAt(i) + " ";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

prefer hacker1[i]

Comment thread js/index.js
let str2 = "";

for (let i = hacker2.length - 1; i >= 0; i--) {
str2 = str2 + hacker2.charAt(i);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

prefer hacker2[i]

Comment thread js/index.js
console.log(`The driver's name goes first`);
else if (hacker1 > hacker2)
console.log(`Yo, the navigator goes first definitely.`);
else

@MarcoSantonastasi MarcoSantonastasi Nov 19, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

prefer explicit condition like " = "

Comment thread js/index.js
let text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc nulla risus, volutpat ut consectetur eu, cursus in elit. Fusce accumsan id arcu a lacinia. Nunc faucibus posuere ante, vel fringilla diam malesuada eget. Pellentesque feugiat non ipsum sed bibendum. Pellentesque sed dapibus ipsum, sit amet volutpat ligula. Donec imperdiet id nibh sed condimentum. Vivamus faucibus quis metus quis gravida. Vivamus dictum feugiat ex, ac tempus justo tincidunt sed. Phasellus nisl justo, eleifend vitae pellentesque ut, tristique sit amet augue. Praesent aliquam porttitor lorem, et euismod risus eleifend a. Morbi mattis gravida ante. Proin metus augue, dictum volutpat sagittis sed, vehicula sed tellus. Pellentesque consequat, justo eu consectetur ornare, ex elit fermentum est, sed mattis diam dolor non lacus. Vivamus laoreet viverra faucibus. Praesent volutpat congue lorem et mollis. In hac habitasse platea dictumst. Vestibulum semper vel lectus ut vulputate. Maecenas sagittis, urna sed accumsan dapibus, justo quam aliquam enim, eget congue lorem massa vel metus. Sed ut ligula orci. Aenean quis porttitor neque. Sed eu massa feugiat, aliquet justo a, rutrum ligula. Quisque sed quam sit amet dui iaculis tristique non et orci. Morbi quis vehicula justo. Vivamus sem dui, aliquam laoreet urna at, vulputate consectetur nisi. Morbi laoreet ullamcorper libero, at vulputate nibh scelerisque at. Ut accumsan, nibh vitae tristique efficitur, massa est placerat dolor, nec ornare mi risus et eros. Ut a risus vel leo vestibulum condimentum. Maecenas iaculis magna felis, in interdum odio lacinia eget. Phasellus eget laoreet est. Curabitur tristique pretium odio nec congue. Phasellus faucibus metus non elit sollicitudin pellentesque. Integer id vestibulum justo. Etiam eros ex, sodales vel est vel, mattis blandit risus. Aliquam et nibh volutpat, rutrum magna ut, fringilla nisl. In ultricies, lacus non hendrerit cursus, ante neque congue enim, eget vulputate velit erat eget est. Mauris varius odio vitae blandit sodales."
let wordcount = 0;

for (let i = 0; i <= text.length; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ERROR: correct to i < text.length

Comment thread js/index.js
console.log(`number of words from text is: ${wordcount}`);

// Iteration 3: Loops No newline at end of file
let found = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could be greatly simplified. Please read documentation about indexOf()

@MarcoSantonastasi MarcoSantonastasi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good.
Iteration 3: prefer localeCompare() as per instructions
Some minor comments

Comment thread js/index.js

let str = "";

for (let i = 0; i < hacker1.length; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

prefer use of localeCompare() as per lesson instructions

@stale

stale Bot commented Dec 19, 2019

Copy link
Copy Markdown

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 19, 2019
@stale

stale Bot commented Dec 21, 2019

Copy link
Copy Markdown

This pull request is closed. Thank you.

@stale stale Bot closed this Dec 21, 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