🔥 Land the job! Get help with a resume and cover letter https://grindreel.com
📚My Courses: https://grindreel.academy/
💻 Learn Code FREE for 2 months: https://bit.ly/2HXTU1o
Treehouse Discount: https://bit.ly/2CZDFNn | IT Certifications: https://bit.ly/2uSCgnz
Want to work at Google? Cheat Sheet: https://goo.gl/N56orD
Code Bootcamps I’ve worked with: 🏫
Lambda School: FREE until you get a job: https://lambda-school.sjv.io/josh
Channel Memberships are here! ❤️ http://bit.ly/32Wj1Jf
My Gear ⚙️: https://kit.com/JoshuaFluke
Social Media 🤳
https://www.instagram.com/joshuafluke/ 📸
https://twitter.com/joshuafluke 🐦
Support the channel! ❤️
https://www.patreon.com/joshuafluke
Donations: paypal.me/joshuafluke
Merch is here! 👕 https://teespring.com/stores/grindreel-2
My P.O Box 📦 if you want to mail me something:
Discord 👊 https://discord.gg/rka6rvg
Website 📡 http://www.grindreel.com/
Email me! 📧 grindreel@gmail.com
Original source
20 responses to “5 Must Know Interview Questions for Javascript!”
Isn't it that you have to run console.log(getPrivateVariable) instead of console.log(getPrivateVariable()) since getPrivateVariable is a variable not a function?
That question you said is using closures is not utilizing closures. There are a couple of things you had mistaken:
– The inner function does have access to the num declared outside in outer function
– The increment on the num in inner is operating on the num declared inside inner, due to hoisting.
To use closures would require a reference to a function to rely on its captured environment to access a variable that would otherwise be 'not defined' in the calling environment.
u r tired & u dont feel sleepy. that's good for us
Smoking that Air Bender kush again?
Nice video 👍
Just read Cracking the Coding Interview , by gayle mcdowell and you should be all set https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850/ref=as_li_ss_tl?keywords=coding&qid=1574641463&sr=8-5&linkCode=ll1&tag=product0d4-20&linkId=d1d3666b82ebed3cf779896204f4a571&language=en_US
With all due respect these are noob questions. Nothing about prototypes, classes and inheritance, closures, functional programming, composition, design patterns, ES6 and beyond.. so many things left behind the scenes
console.log(secretVariable()()); …I just accessed your “private variable”.
The correct answer is JavaScript doesn’t have or allow private variables. But, with closures you can limit the scope of a variable.
MAGIC STORY ARE IMPORTANT BUT ALSO SOME TIME YOU CANT DO MUCH WITH THEM MUCH ABOUT PAIN AND CRAZY LABS THAT DONT DO WELL ( WELL THE GOOD IS IN THE SIMPLE THINGS ALSO ) IN WORLD FOR SUPERIORS HOW EVER 80% OFF PRICE FOR THOSE WHO ARE ENOUGH ON WELL LIFE POST . WITH SOME OLDER FORMS AND ALSO HALF FINISHED POSTS .
Hi thank you for this and nobody hires people that only knows Javascript right? I mean you suppose to know the whole front-end thing right?
function secretVariable(){
var private = 'super secret code';
return function(){
return private;
}
}
console.log(secretVariable()());
This works too.
JavaScript sucks so bad.
Don't work for any company that asks anything like these. Moreover, if you get an offer with these answers, run away. There's no excuse in 2018 when this video was made and especially not in 2019 to be using ES3 and relying on people understanding oddities with hoisting or this. If you write modern JS, these things literally never come up, and they should fail a lint check and a code review. Think about what it means for a company to be asking you a question. An interview is just as much an opportunity for you to learn about the company.
I’m coding since 16 years and I would fail the interview
u literaly explained NOTHING!
I'm sorry but I've been using js for maybe 2 months (if i segment the hours ive worked into 40hr weeks) and these questions kinda seem to easy. are these genuine questions they'll ask you? if so I've been underestimating my abilities lmao.
I knew all but the last. I've not got the hang of binding. Any advice or sources?
Cool vid man, thanks! I'm currently self-learning JS and videos like this help with confidence. The ES6 way of push and unshifting elements to an array was something I didn't know, so thanks for that!
I think you should have mentioned that .bind() RETURNS a function that can be used later for people that dont get what's going on with that at the last example.
why you don't use the live server from VS Code?
Get the code runner extension for vscode so you don’t have to keep pasting your code into the console