Skip to content
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

rozwiązania #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

rozwiązania #6

wants to merge 1 commit into from

Conversation

dadlez
Copy link

@dadlez dadlez commented Jan 30, 2018

No description provided.

Copy link
Contributor

@Ami777 Ami777 left a comment

Choose a reason for hiding this comment

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

Dobre, eleganckie rozwiązanie.

if (!err) {
files.forEach(file => {
readContent(path + file);
Copy link
Contributor

Choose a reason for hiding this comment

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

Super, tak jest dużo czytalniej.

const outputPath = './data/zadanieDnia/output.txt'

const setCase = (letter, index) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Bardzo fajny podział na osobne funkcje!

Copy link
Author

Choose a reason for hiding this comment

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

No właśnie mam wrażenie ze setCase jest już niepotrzebny przy zoptymalizowaniu kodu do jednego wiersza.

Bardziej jestem niezadowolony z pętli for, która próbowałem zastąpić: text.split().forEach((letter, index) => ...itd, ale nie wiem czemu otrzymywałem pod letter cały tekst. Czy split(’’) zadziała?

Copy link
Contributor

Choose a reason for hiding this comment

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

Tak, split(''), bo "If separator is omitted, the array returned contains one element consisting of the entire string. If separator is an empty string, str is converted to an array of characters." (https://developer.mozilla.org/pl/docs/Web/JavaScript/Referencje/Obiekty/String/split)

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