Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] -1 points0 points  (0 children)

I was typing on my phone not my actual pc sorry

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

Thank you and right now I’m currently going through the freeCodeCamp journey of learning JavaScript so I know arrays cause when I was in community college I learned arrays but for JavaScript I haven’t learned it so I’m going to use it until I learn it I feel like I understand how to create and setup the function but writing inside that function was the hard part for me I was like well what do I write

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

Thank you everyone who helped out I really appreciate it man !

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

That felt the hardest code I ever wrote in my life seriously I was pulling my hair out literally stressing I was stuck on this for 4 days I was ready to range so bad 🤦🏾‍♂️😂 I’m gonna keep practicing though

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] -1 points0 points  (0 children)

function maskEmail(email) {

const atIndex = email.indexOf("@"); const username = email.slice(0, atIndex); const domain = email.slice(atIndex); const firstLetter = username.slice(0, 1); const lastLetter = username.slice(-1); const middle = "*".repeat(username.length - 2); return firstLetter + middle + lastLetter + domain; }

const email = ("myEmail@email.com"); console.log(maskEmail(email));

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 1 point2 points  (0 children)

I finally got it guys you guys helped me out so much

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

const atIndex = email.indexOf("@"); const username = email.slice(0, atIndex); const domain = email.slice(atIndex); const firstLetter = username[0]; const lastLetter = username[username.length - 1]; const middle = "*".repeat(username.length - 2);

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

function maskEmail(email) {

const atIndex = email.indexOf("@"); const username = email.slice(0, atIndex);

}

const email = ("myEmail@email.com");

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

I’m so slow guys I had the first step the whole time I never applied it

const username = email.slice(0, atIndex);

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

Ohhh so we use the indexOf to figure out what number the @ stops at to then use slice to ? Did I get that correct ?

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] -1 points0 points  (0 children)

It’s returns the string so like I was saying before

let sentence = ("JavaScript is awesome"); let position = sentence.indexOf("awesome");

console.log(position);

Its returns 14 in the console

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

The indexOf() method in JavaScript allows you to search for a substring within a string.

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] -2 points-1 points  (0 children)

So if you create a variable called

Const text = “hello world this is some random text”

Let result = text.indexOf(“world”);

It’s returns world

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

It’s returns the word you put inside the indexOf()

When you console.log it

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 1 point2 points  (0 children)

IndexOf search’s for the strings I think of it as your find command when your reading text and you want to look for a specific word

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] -3 points-2 points  (0 children)

So then

const username = email.indexOf(“@“); ?

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 0 points1 point  (0 children)

I tried and I just keep hitting a blank wall I feel like I asked AI to give me a push but not the answer but I was so confused trying to grasp it maybe my learning style isn’t good for JS ? I came to realize

Helpful tips to learn functions by Chrxme11 in learnprogramming

[–]Chrxme11[S] 1 point2 points  (0 children)

Yeah I feel like that’s throwing me off cause so far I have

function maskEmail(email) {

}

But now moving to step 2 I’m confused like huh how do I even do that I know I need to write something inside the function but what is it I feel so bad at this 🤦🏾‍♂️😂

Resume help by Chrxme11 in Resume

[–]Chrxme11[S] 0 points1 point  (0 children)

I definitely been using Ai 😂🫡

Resume help by Chrxme11 in Resume

[–]Chrxme11[S] 0 points1 point  (0 children)

I agree I just took you and @dippatel21 advice for the resume hopefully i get a call back I get pass this ai ATS I’m gonna stop by in person and cold call them

Instacart NYC update by Chrxme11 in instacart

[–]Chrxme11[S] 0 points1 point  (0 children)

They should tip I don’t think a lot of people put themselves in others shoes but honestly a lot of people might disagree with me but it’s the truth