You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The official solution has the toLowerCase() and toUpperCase() methods on the wrong sides of the ternary expression based on the wording in the challenge. "... convert even-numbered lines to upper-case and odd-numbered lines to lower-case. Consider the first line to be odd-numbered. ..."
Also, the lineCount is defaulted to 0 and the increment is not called until after the output has been queued. This would mean that the first line will be upper case instead of lower case, assuming the above error has been fixed. Either lineCount needs to be defaulted to 1 or the increment call needs to be before the output is queued.
The text was updated successfully, but these errors were encountered:
0%2 is equal to 0, so the first line which is nothing but line[0] will be converted to lowercase and the second line which is nothing but line[1] will be converted to uppercase.
I tested the official solution and it passed, so I don't understand why the issue is saying it's incorrect. I think the issue is rather saying that the syntax used in the example solution is not very readable?
The official solution has the toLowerCase() and toUpperCase() methods on the wrong sides of the ternary expression based on the wording in the challenge. "... convert even-numbered lines to upper-case and odd-numbered lines to lower-case. Consider the first line to be odd-numbered. ..."
Also, the lineCount is defaulted to 0 and the increment is not called until after the output has been queued. This would mean that the first line will be upper case instead of lower case, assuming the above error has been fixed. Either lineCount needs to be defaulted to 1 or the increment call needs to be before the output is queued.
The text was updated successfully, but these errors were encountered: