-
Notifications
You must be signed in to change notification settings - Fork 252
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
base: master
Are you sure you want to change the base?
rozwiązania #6
Conversation
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.
Dobre, eleganckie rozwiązanie.
if (!err) { | ||
files.forEach(file => { | ||
readContent(path + file); |
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.
Super, tak jest dużo czytalniej.
const outputPath = './data/zadanieDnia/output.txt' | ||
|
||
const setCase = (letter, index) => { |
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.
Bardzo fajny podział na osobne funkcje!
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.
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?
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.
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)
No description provided.