Question Inna Panchenko in lesson «Pure functions and side effects», course «Programming fundamentals»

Inna Panchenko

Help me, please. I don;t understand my mistake. The Output said so amasing thing: ` FAIL tests/solution.test.js ● solution

expect(received).toBe(expected)

Expected value to be (using ===):
  "Hello, World!"
Received:
  ", !"

  at Object.<anonymous>.test (__tests__/solution.test.js:4:79)

✕ solution (6ms)

Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total`

My code is:

```import * as strings from './strings';

// BEGIN (write your solution here) const solution = (str) => { let result = ''; for (let i = 0; i < strings.length(str); i += 1) { if (strings.toUpperCase(str[i]) === str[i]) { result = result + str[i]; } }

return String(result); }; export default solution; // END

What's wrong with letters?
As for me, the cause lies in the

if (strings.toUpperCase(str[i]) === str[i]) { result = result + str[i]; }

Ivan Gagarinov

Inna Panchenko, Good afternoon! We're sorry we didn't respond in time. During this time, we have an up-to-date course https://hexlet.io/courses/js-basics. You can try to pass it. If you have any questions with the exercises, you can save your solution and drop the link.

Use Hexlet to the fullest extent!

  • Ask questions about the lesson
  • Test your knowledge in quizzes
  • Practice in your browser
  • Track your progress

Sign up or sign in

By sending this form, you agree to our Personal Policy and Service Conditions
Suggested learning programs
profession
Development of front-end components for web applications
10 months
from scratch
Start at any time
profession
Layout with the latest CSS standards
5 months
from scratch
under development
Start at any time
profession
new
Developing web applications with Django
10 months
from scratch
under development
Start at any time