0:40 Everything you said is correct; I just wanted to show how we can implement this approach. We can bind the function by using bind(). Since we want to reuse the function later and have a reference to it, we can use bind() as follows: const getName = obj.getName.bind(obj). Then, line 8 will work correctly.
0:40 golden rule to remeber with this is where it was called from no mattter what the trajectory was, the call site matters in almost nearly all of the cases since in getName we are just storing the reference of the method it was actually called by getName which is defined in the global scope and thus undefined
For first challenge if you run this code in browser it will give you empty string and if you run that in codepen it will give you codepen and if you run that on in stackblitz it will throw error
I’m learning JS and I completed the first four challenges without any trouble. The next challenge is about array methods, which I’m not yet familiar with, so I’ll learn about them before proceeding with this video. I’ll come back to this video later. I really appreciate you for making this video because it makes learning much easier. I’ll subscribe for more great content like this.
Glad you enjoyed the video so far! Also fwiw, there is no order to this video. It's also not meant to be some magical all-encompassing test, it just intentionally touches on some points that I find a lot of developers never learn about.
Glad you enjoyed it! To be clear, I wouldn’t expect these types of problems to be asked in many interviews. They’re more of just interesting problems that can help test your knowledge of different concepts, not interview problems. I might make more interview specific content in the future though (and more of these challenges) 🤝
They can ask whatever they want lol. But most commonly for frontend you'll get a mix of traditional algorithm questions and some JS specific questions. Depending on the role/company, these could be pure JavaScript questions, or they could require you to interact with the DOM or even use a library/framework like React. Shameless plug - here's 50 frontend coding interview questions we created on FrontendExpert. Particularly the JavaScript and Dom Manipulation questions are probably the most realistic: www.algoexpert.io/frontend/coding-questions
I think it is more confusing rather than hard. My answers before I see the actual output. 2:33 I think this is called closure. Out 2 1 3:32 Out [1, 2, one, two, 4, 5] 4:24 even though it is 0 sec. Out 1 3 2 5:41 ok, I haven't seen a comma operator inside a parentheses before. That is not a function. So .idk. 6:24 This is not how you check for deep equality in JS. Out False False 7:26 This can work, but this is not the syntax. Out Error? 8:14 Hmm, not sure, but Out 5 10 20 The question now is, do you really care about what I or what someone else did?
Got only the last one incorrect, i completely forgot the last one was gonna log a pending promise. Really fun questions tho. Had no idea what variable= (1,2,3) is but instinctively thought its gonna resolve to the last value
I was an intern convert, so really my true interview was the internship. That said, my intern interviews were standard algorithm problems (I didn’t go through any frontend specific track, if there even is one for interns).
0:40 Everything you said is correct; I just wanted to show how we can implement this approach. We can bind the function by using bind(). Since we want to reuse the function later and have a reference to it, we can use bind() as follows: const getName = obj.getName.bind(obj). Then, line 8 will work correctly.
0:40 golden rule to remeber with this is where it was called from no mattter what the trajectory was, the call site matters in almost nearly all of the cases since in getName we are just storing the reference of the method it was actually called by getName which is defined in the global scope and thus undefined
I got all correct except the promise one
Love it, bring more of this.
I was able to do most of them
Very usefull. Thanks for your great content, Conner!
Only the last one with the Promise was confusing for me. The rest is quite simple. Thanks!
4:22 throw in promises into the mix for a good measure
Thank you! Very interesting ❤
Thank you so much for useful information!!!!!!
For first challenge if you run this code in browser it will give you empty string and if you run that in codepen it will give you codepen and if you run that on in stackblitz it will throw error
Damn, i definitely learnt something new today. I got hung up on the object and promise ones.
My favourite JS youtuber, I always learn something from you vids.
I didn’t know JavaScript was this complicated until I see your contents. They’re really helpful! Thank you. :)
Tu samjha.... Nai tu nai samjha
illl tell u why - its bc u skipped to typescript just like every web developer who want to be hip lol
@@harryzhuno i didn’t
I’m learning JS and I completed the first four challenges without any trouble. The next challenge is about array methods, which I’m not yet familiar with, so I’ll learn about them before proceeding with this video. I’ll come back to this video later. I really appreciate you for making this video because it makes learning much easier. I’ll subscribe for more great content like this.
Glad you enjoyed the video so far!
Also fwiw, there is no order to this video. It's also not meant to be some magical all-encompassing test, it just intentionally touches on some points that I find a lot of developers never learn about.
@@ConnerArdman I see, but still it's helpful for me because I'm newbie to programming and coding stuff, I'm one month old in JS 😂
Bro where you are learning JavaScript pls reply
@@llegenda-r3c OMG! My comment got deleted for the third time.
i have learned comma operator, invalid object property name and duplicating variables, thanks
I think code challenges or more interview prep for js and react for the 2023 market would be great, in terms of what to expect now. Great content.
Glad you enjoyed it! To be clear, I wouldn’t expect these types of problems to be asked in many interviews. They’re more of just interesting problems that can help test your knowledge of different concepts, not interview problems. I might make more interview specific content in the future though (and more of these challenges) 🤝
@@ConnerArdmanHi Conner, so what question can be asked in an interview
They can ask whatever they want lol. But most commonly for frontend you'll get a mix of traditional algorithm questions and some JS specific questions. Depending on the role/company, these could be pure JavaScript questions, or they could require you to interact with the DOM or even use a library/framework like React.
Shameless plug - here's 50 frontend coding interview questions we created on FrontendExpert. Particularly the JavaScript and Dom Manipulation questions are probably the most realistic: www.algoexpert.io/frontend/coding-questions
Love your video. they're straight to the point. Keep doing more videos like this..
I think it is more confusing rather than hard.
My answers before I see the actual output.
2:33 I think this is called closure.
Out
2
1
3:32
Out
[1, 2, one, two, 4, 5]
4:24 even though it is 0 sec.
Out
1
3
2
5:41 ok, I haven't seen a comma operator inside a parentheses before. That is not a function. So .idk.
6:24 This is not how you check for deep equality in JS.
Out
False
False
7:26 This can work, but this is not the syntax.
Out
Error?
8:14 Hmm, not sure, but
Out
5
10
20
The question now is, do you really care about what I or what someone else did?
the only one I didn't know was the one that looked like a tuple
Got only the last one incorrect, i completely forgot the last one was gonna log a pending promise. Really fun questions tho.
Had no idea what variable= (1,2,3) is but instinctively thought its gonna resolve to the last value
Nice job! 👌
Yes i want to see more of these. You're a great content creator
Thank you! Glad you enjoyed it 😃
Actually learning from you alot dude you truly JavaScript Sensi 🧑🏫🧑🏫
Man , i got JS knowledge in these 10 mins more than my whole 4 years of college 🔥🔥
hey conner what sort of interview question you got for facebook was it purely algorithm based or js based or ? frontend concepts
I was an intern convert, so really my true interview was the internship. That said, my intern interviews were standard algorithm problems (I didn’t go through any frontend specific track, if there even is one for interns).
Thank you!
6:56 seem that the most confusing thing in js pass by value and pass by reference
damn, best content ever. love it, upload more pls
Thank you!
I actually got most of them right
Guess im getting strong in js😊
I will give myself a B. I got a few of them, but I also messed up a few. Fun video!
Nice! Glad you found the video fun 😃
Amazing video, please make more video like this
Thanks! Will do 👌
I answered all of them correctly 😂maybe I didn't knew I know JS that much
Great content 👍
Thank you!
How to master JavaScript make roadmap on that. Pls
I got 8/10
😮
it was easy enough..xd
Imagine someone coming from static language and see this JS crap
i remember all of those questions from my first js interviews 🥲