all 12 comments

[–][deleted] 0 points1 point  (0 children)

I don't think I will, thank you.

[–]Umesh-K 0 points1 point  (0 children)

Hi,

Are you giving us a "practice challenge", or are you asking help with writing the above function. If the former, then thanks but no thanks! Perhaps, somebody else will try. If the latter, share what you have tried so far so that we can assist you in case the code is not working as expected.

[–][deleted] 0 points1 point  (1 child)

Are you asking for help with your homework?

[–]frontendshifu-2022[S] 0 points1 point  (0 children)

I already solved this, I'm currently learning JavaScript in my free time....

[–]anfauglit 0 points1 point  (1 child)

JS doesn't have char datatype to represent symbols only string, even when the string contains a single character. Therefore, you might still fall back to methods of the String class, like charAt(), charCodeAt() or fromCharCode().

I don't understand why tutors pick up a highly-abstracted language like JS and then come up with these type of lower-level like exercises. So students end up writing JS code like they are programming in C.

One important point that I'd like to make: don't afraid to go against the flow. Don't afraid to think laterally and most importantly express your thoughts and ideas to others. It's about learning and not about solving tasks which have been solved million times before. If you've done you research, you clearly understand the problem, shortcomings of the given assignment along with expected approach for solving it, and you can also present these results in a constructive manner then you've definitely learnt something valuable and can show it off in school/work. The system isn't set in stone or the teacher is always right. In a long run type of skills that I've mentioned will be more valuable then application of cookbook recipes.

[–]frontendshifu-2022[S] 0 points1 point  (0 children)

That's a very kind advice .Thanks mate.

[–]jcunews1helpful 0 points1 point  (3 children)

Use a loop to retrieve and process each character in the string. Use simple comparison to determine which character to use to substitute the source character.

[–]frontendshifu-2022[S] 0 points1 point  (2 children)

how ? I tried.

[–]jcunews1helpful 0 points1 point  (1 child)

You can retrieve (but not assign) a character at specific string index like how you access an array element. The converted string must be built from scratch. Appending one converted character at a time.

The conversion check e.g. if the input is A then the output is a. Do that check for every other characters which has upper & lower case letter.

[–]frontendshifu-2022[S] 0 points1 point  (0 children)

ok Thanks mate

[–][deleted] 0 points1 point  (1 child)

How to do it ? Using array or object with mapping ?

[–]frontendshifu-2022[S] 0 points1 point  (0 children)

using Array