Got my first developer job

@TK42DAN @jazztbone2b @mohessaid @DarDip @holodon @fizzvr
Thank you all so much, this is so lovely of you!

1 Like

I looked at Enikol’s challenge question for a while because it wasn’t obvious to me, and I learnt a few things in the process.

Firstly I had not seen let before: replacing var with let works very well - so well done on you for identifying that as a good solution!


This is what I came up with, before I noticed your answer:

for (var i = 0; i < 5; i++) {
console.log("Set up for i = " + i); // extra line to show the loop running setting the Timeouts
setTimeout(function(val) {
console.log(val);
}, i * 1000, i);
}

Again it is the scope issue with the variable i. In the original version which Enikol was tested on, one is tempted to think that i has the same value inside the loop, but it doesn’t. By using val as the variable to the anonymous function, I am making it clear that it is a different variable with different scope. The Docs for setTimeout make this clear. They also talk about

The “this” problem

The standard way to pass an argument to the anonymous function is to include it after the i * 1000, as I have done:

var timeoutID = scope.setTimeout(function[, delay, param1, param2, …]);

I added an extra line to show the loop running when it sets the Timeout values at the beginning.

What I wasn’t able to do was to get it working using IIFE, and I would welcome any comments which show that.

My research has helped me, and I hope my comments may help someone else too.

1 Like

Congrats @Enikol! I do have a question about Git. How deeply are you getting into Git at your job (how advanced are the commands you use regularly)? Just curious as I continue to learn and use more Git & command line.

Thanks and best wishes!
Joe

Thanks! Actually, I can’t say we use very advanced commands, mostly it’s pull --rebase (is slightly different from git pull), stash, amend and of course creating, commiting, pushing and merging branches. That’s pretty much all we need so far!

1 Like

Got ya! You never know what portions of classes, tutorials, etc. are actually used often so this is helpful. Thanks again :slight_smile:

1 Like

Hey, I’ll!! That’s for sure.

Congrats on your new job, wish you all the best

1 Like

Hi,Kate!
Congratulations to your first developer job!! are you now a frontend JS oder full stack developer?

may I ask you - have you finished both frontend and backend courses and projects at FCC?
or what was your curriculum beside FCC and the guide by @P1xt306?
also how many hours did you devoted to coding?

Good luck at your job and enjoy it !:wink:

Hi! I a junior frontend, and I finished all FCC beta curriculum (excepet interview prep questions, I’m somewhere on the data structures section now), MEAN stack course from the guide (it’s free, so I recommend checking it out), a React course from Udemy by Steven Grindern (it was good, but you absolutely can learn React without it), read YDKJS, Javascript Allongé and Dom Enlightenment. As for hours, I really can’t tell you precisely - some days it was 6-8 hours, some days it was an hour, some days, well, zero. Mostly 3-4 hours, I think? But I don’t think the amount of time is that important, it’s mostly about consistency. Hope that helped!
Thank you and goos luck to you too! :slightly_smiling_face:

Yep :slight_smile: Worth to summarize that let scope refers to the curly braces( { } ) and var to the function it was created in. Hence let alone is enough but for var we need to wrap our setTimeout into function (normal or IIFE).

Congratulations!:grinning: