JavaScript task

I was given this task to complete in JavaScript. But the question hit me so hard that I have to struggle just to solve it It took me a copilot just to solve it
No description
24 Replies
Jochem
Jochem2mo ago
Did you have a question? also, if you just asked copilot to write that function for you, you didn't solve it
ἔρως
ἔρως2mo ago
i can't see how this is an hard task to understand
Jochem
Jochem2mo ago
you're robbing yourself of an education you're paying for (if not with money than at least with time) it can be as a beginner, breaking down problems is its own challenge. Lets try not to be discouraging unnecessarily
ἔρως
ἔρως2mo ago
that's not it the question is pretty well broken down already and it has examples
Jochem
Jochem2mo ago
there's no actual breakdown, just hints for methods you can use but lets not argue about that, it's not on topic here
CHIDEX
CHIDEXOP2mo ago
But I didn't copy the code Is that number 2 that I did understand
Jochem
Jochem2mo ago
that's honestly the real question, number 2 is the actual problem statement. Where are you getting stuck? within number 2 that is
ἔρως
ἔρως2mo ago
that is also divided into 2: - the "draw the rest of the owl" part - hints on how you can do it, with string methods you can use, for you to go and investigate about them
CHIDEX
CHIDEXOP2mo ago
The whole question on number 2 is just confusing me although copilot is breaking it down for me in a way I will understand I don't copy code but learn how to solve the code.
Jochem
Jochem2mo ago
I still think that copilot is not a good idea at this stage in your learning journey what did you do before you reached for copilot? Did you read the method descriptions for the suggested methods?
CHIDEX
CHIDEXOP2mo ago
I tried to understand the question but no way
ἔρως
ἔρως2mo ago
you're trying to understand the equivalent of "cook the dish"
Jochem
Jochem2mo ago
what did you do to try to understand the question though? Did you read the method descriptions for the suggested methods?
CHIDEX
CHIDEXOP2mo ago
That means reaching to ai is very wrong
Jochem
Jochem2mo ago
or do you mean understand the question as in what output a certain input should produce? Did you understand the part where testaddress@example.com should produce t*********s@example.com? yes, honestly
CHIDEX
CHIDEXOP2mo ago
As a beginner I am The question seems strange to me Exactly
Jochem
Jochem2mo ago
I'm not sure how it seems strange, can you put that a bit more explicitly? oh, so you didn't know what output it should produce?
CHIDEX
CHIDEXOP2mo ago
I know what it will produce What I understand here is putting more effort on my studies
Jochem
Jochem2mo ago
just "putting more effort" isn't a useful answer to take away from this. What I'm getting is that you don't quite know what effort to put where, and you haven't given me enough information for me to help guide you there... So if I'm understanding you correctly, you know that testaddress@example.com should produce t*********s@example.com?
CHIDEX
CHIDEXOP2mo ago
Yes And is slice() that I will use to produce the ** The indexOf to call out the strings before @
ἔρως
ἔρως2mo ago
did you read what the slice method does? and the indexof?
CHIDEX
CHIDEXOP2mo ago
Yes The slice extract letters from the string And indexOf counts the number of a character or letters before the mentioned one inside the indexOf parameters like let name = "Chidera is a programmer" console.log(name.indexOf(is))//7 Maybe I am not correct I said this without looking at no documentation
ἔρως
ἔρως2mo ago
then you should go to the mdn website and read about those string methods also, the result is 8, not 7 and it's not the "before": it's the actual index, which starts from 0 but just google "mdn string <method>"
CHIDEX
CHIDEXOP2mo ago
Thank you sir Let me study it again

Did you find this page helpful?