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

24 Replies
Did you have a question?
also, if you just asked copilot to write that function for you, you didn't solve it
i can't see how this is an hard task to understand
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
that's not it
the question is pretty well broken down already
and it has examples
there's no actual breakdown, just hints for methods you can use
but lets not argue about that, it's not on topic here
But I didn't copy the code
Is that number 2 that I did understand
that's honestly the real question, number 2 is the actual problem statement. Where are you getting stuck? within number 2 that is
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
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.
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?
I tried to understand the question but no way
you're trying to understand the equivalent of "cook the dish"
what did you do to try to understand the question though?
Did you read the method descriptions for the suggested methods?
That means reaching to ai is very wrong
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, honestlyAs a beginner I am
The question seems strange to me
Exactly
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?
I know what it will produce
What I understand here is putting more effort on my studies
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
?Yes
And is slice() that I will use to produce the **
The indexOf to call out the strings before @
did you read what the slice method does?
and the indexof?
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
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>"
Thank you sir
Let me study it again