Nice tutorial before appearing for JS interview. I had gone through a few interviews and was asked most of these questions and also them: 1. Spread Operator 2. Bind, Call, Apply in JS 3. Array Questions (deep copy and shallow copy of array using assign;also map property used many a times) 4. Ques based on Object Keys Hope it helps! (I would appreciate if you make some short video on these topics as well)
0:33 - what is prototypal inheritance 2:58 - what is the difference between function declaration & function expression 4:21 - what is promises and why do we use it 6:43 - setTimeout() 8:23 - what is closure and how do we use it
8 out 10 questions were asked in my interview, after listening to your tutorial , i am pretty confident about everything .thank you so much gurujiii, all the best!! great going !!!
5)When do we use Arrow functions? Arrow functions make our code more concise, and simplify function scoping and the this keyword. By using arrow functions, we avoid having to type the function keyword, return keyword (it’s implicit in arrow functions), and curly brackets. This keyword in arrow functions A normal function has its this keyword ie the scope of this keyword in normal function is its function. whereas in arrow fnction, fat arrow does not have its this, fat arrow takes this from its parent function Which takes us to a conclusion that you should use fat arrow/arrow function when you want to use this of parent function, in case you want to use this of current block/function you should use normal function. for eg take this eg. //profile is an object const profile = { firstName: '', lastName: '', setName: function(name){ let splitName = function(n){ let nameArray = n.split(' '); this.firstName = nameArray[0]; this.lastName = nameArray[1]; } splitName(name) } } profile.setNmae("vikram sharma); console.log(profile.firstName) this code will not give us any output as "this" keyword in normal function will look for its value in the same function only(which is this) setName: function(name){ let splitName = function(n){ let nameArray = n.split(' '); this.firstName = nameArray[0]; this.lastName = nameArray[1]; } , whereas if we use arrow function const profile = { firstName: '', lastName: '', setName: (name) => { let splitName = (n) => { let nameArray = n.split(' '); this.firstName = nameArray[0]; this.lastName = nameArray[1]; } splitName(name) } } profile.setNmae("vikram sharma); console.log(profile.firstName) This will give the output as vikram, becasue fat arrow automatically sets this keyword to setName ie its parent. 6) What is prototype inheritance? Every object has a property called prototype, by which you can add methods and properties to it and when you create other objects from these objects, the newly created object will automatically inherit the properties of the parent, not by including in its own properties but instead it uses from its parent. The way it works is, when you call a particular object or a method it first looks at its own properties if its there and if its not there it will look in its parents properties, therfore this way objects are much lighter. eg: let car = (model) => {this.model = model} car.prototype.getModel = () => return this.model let toyota = car("toyota") console.log(toyota.getModel()) ie we inherited model property from our method car in another method getModel by protyping car 7) what is the difference between function declaration & function expression? console.log(funcD()) ---> function declaration //ie its available to us even before its declaration console.log(funcE()) ---> error // its saved to a var and will behave like one, moreover it has a variable scope function funcD() { console.log("function declaration") } let funcE = function() { console.log("function expression") } 8) what is promises and why do we use it? We use promises to simplify a callback hell
9) What is setTimeout()?
10) what are closures? When a func returns another func, the returning function will hold its environment "Closures are functions that refer to independent (free) variables. In other words, the function defined in the closure 'remembers' the environment in which it was created
let obj = function(){ let i=0; return { setI(k) { i=k; } getI() {return i} }}
Thanks, almost all above questions were asked in my interview and I had no clue about a few of them and I was rejected, your tutorials are too good for the beginners. keep motivating us... thanks a ton.
omg, last week I literally got asked all these questions except for the prototypal inheritance and the function declaration vs expression thing. I hate to say that at that time I didn't find your video so I wasn't able to answer what a closure was. And they also gave me a tricky settimeout exercise. Anyways, they asked for a second interview and here I go again! Thanks a lot for the info!
what is prototypal inheritance? 0:27 what is the difference between function declaration and function expression? 2:57 what is promises and why do we use it? 4:22 setTimeout() 6:42 what is closure and how do use it? 8:22
I watched this tutorial after having watched your other tutorials on Closure, Promise, Call-Apply-Bind, and I have to tell you all three questions puzzled me in my latest interview - so thank you again for sharing these nuggets and helping us better understand problems that puzzled us in the first place!
Great videos (both of them), thank you. Having said that, I could spot one mistake. At 4:00 its stated that to pass a function as an argument to another function we would have to use a function expression. This is not true, we can pass a function declaration as well. Also, it is worth mentioning that function declarations are hoisted whilst function expressions are not.
Also would like to add that Promise actually gets queued up in the microtask queue while setTimeout gets queued up in the callback queue. The prioritization of the event loop is that microtask queue -> callback. Therefore if you try to do a setTimeout before a promise ,let say to fetch some API , a promise will actually get returned first.
My first JS interview was fun, ya I didn't do well. But when I was asked those questions, I felt that I knew the answers but not able to answer them. The questions include closures, inheritance and ES... That was fun. And now I am getting into JS stuff ... And these videos are helping me. Thanks :)
I feel you . I know most of the time you know the answer however when interviewer asks our mind just freezes and then it freezes more :) Good luck with your interview. Just relax and take your time .
Just wanted to comment that you CAN pass a declared function in as a variable. You give the function a name in the declaration. So in his example, you'd be able to pass funcD into funcE (if funcE accepts arguments), so something like...funcE(funcD) would console log out both strings (again...if funcE calls the argument passed in)
Hey Buddy, This is the best javascript channel i have seen who covers the topic which are hands on daily javascript programming and The content of this channel is very helpful for beginners as well as mid senior JS developer who is appearning in JS interviews. I want to say you something that why you dont try some aws and node js advance practices that will be very helpful for the subscribers to understand modern trends. Thanks For all your help!
yes because when you pass function declaration as an argument it converts to a "named function expression" . I would work fine in this case but there can be scoping issues like following would also work but it shouldn't function runAndLog(f) { console.log(f()); } runAndLog(one); function one() { return 1; }
Few of the Questions asked in my Interviews so far. 1. [x,y,z] = "abc"; Console.log([x,y,z]) 2. Why does Javascript have both null and undefined? What was the need to retain undefined? 3. for(var i =0; i
I wasn't able to answer most of these. Few Questions mentioned in your video were also asked in the Interview. Your videos has helped me understand JS better. Thank You.
Thank you for your help. I wish I would have seen this before my last interview. I like how clear and concise you are with your explanations but I wish that your microphone was a little bit louder.
@techsith, 4:10, I think you can pass function declaration as an argument, should work. Not sure if I understood you properly, because the following code works, function count(val){ console.log(val); } var t = function(func){ func(5); } t(count); // prints `5` In JavaScript, functions are high order objects.
As soon as you pass function desecration to another function it becomes function expression becase it hold inside a variable inside the function. so its no longer function declaration.
@@Techsithtube yes, as a variable in the function agruments per se. I think it would be worth mentioning that, else people might think it is not possible, or it would throw an error if we pass a reference to a function declaration as an argument. :)
Thank you..missed call Bind and Apply in this video..frequently asked and we struggle to answer that..anyhow i checked it in advanced javascript tutorials
I am a big fan of urs, You explain things in very efficient way, One question "How does JS manage multiple events in parallel, like click, input, etc. when it is interpreted & single threaded?"
JavaScript is more optimal in that sense. it is single threaded and the way it works is very simple. anything that is synchronous will get on the stack and gets executed one by one. However anything asynchronous gets on a queue where it waits for its turn. and when its ready to be executed it waits for the stack to be empty . I have a tutorial on settimeout where i explain it more clearly. ALso look at tutorial for webworkers. which allows you to simulate multithreading with some restrictions.
This is a hidden treasure I have found. Very informative and nicely put. you are a gem of a person and I really liked the way you have explained the topics with ease.. kudos and keep up the good work and I’ll look forward to more videos from you.
I have an interview tomorrow and mostly about javascript. I have a feeling that I will fail it but many thanks that I found and watched your video. Very helpful!!
Hi there I am wondering if we can compare the concept of "promises" in javascript to be similar to "delegates" in C#? Are they the same thing? In C#, Delegates are function pointers which are useful for callbacks and checking the current status of another running function while within one. They allow you to pass methods as objects. I am wondering if the two concepts are similar. Surprisingly I never knew about either of these before these last few months, so I have been trying to use delegates in C# but mostly in toy problems so far. I am struggling to understand practical usage for these despite watching and reading many things.
No. Delegates in C# are roughly treated as function pointers. Promise api is very different kind of pattern to do async programming and to provide an easier interface for method chaining. Am I clear? Delegates on the other hand
Great questions! I’d like to suggest switching to a dark theme for your IDE. Watching this on a large display, your editor is just a wall of white light and difficult to read. Thanks for your videos!
In last example you returned an obj with 2 functions (setI and getI) that didn't had the function keyword ih their declaration. I honestly thought that wouldn't work! Thanks for the tutorial.
at the 4:00 examples difference between function declaration & function expression ; IF you used a VAR instead or a LET for funcE, instead of throwing an error wouldn't it show as a undefined for funcE just like it did for funD?
No, it would be the same. That 'undefined' was a 'return value' from the console.log And funcE variable would still be unassigned, so it will give error that undefined is not a function (I think so)
Thanks for the video. The example you used for prototypal inheritance was actually the function definition using prototypes. There is no child parent relation anywhere. Correct me if I am wrong.
Its called function constructors. Base class and subClass relationship is established using prototype chain. I actually have series on Object Oriented JavaScript where I explain this in more detail. Please check it out.
4:10 I'm not sure why you said in the video we can't pass function declaration into another function? If we declare a function we can pass it as an argument to another function.
v helpful... can i request you to pls do a video on generators that is tied in to a practical use case... a lot of the tutorials on generators seldom go beyond explaining the syntax... thanks again for producing JS content
Generators will be replaced with async/await in ES7 which has much easier syntax. I recommend to look into it. It will replace the current promise pattern too (.then .catch).
Honestly I would not use them at all. They are old memes that take any seriousness of content away. I would just find a logo. You already got a brand with the color and font used. javaScript call apply and bind for example looks so nice compared to ones with rage memes But if they work for you then ignore my opinion. It is just another opinion on the internet. Wish you the best :)
What do you think the future holds for Angular? I have tried both Angular and React and Angular comes more natural for whatever reason. With this whole patent thing, could we see more people turn to Angular? I know that Vue is the newest and hottest framework right now but still....
I have have used both as well and Angular also feels natural to me. There are companies who would go for it because its a complete solution . So I think it will continue to do good event with all these other frameworks around it.
You can pass a function declaration as an argument to another function though. function innerF() { console.log('I ran!'); } function outerF(inner) { let a = inner(); } outerF(innerF); // 'I ran!'
I did not know that. Thank you. So by putting parentheses around the function you did, say like you do with an IIFE, I understand that this is a function expression, but what I don't understand is how calling a function created as a function declaration inside another function makes the inner function a function expression. For example, if I define a function declaration and then pass it in as a callback in an event listener, it doesn't become a function expression, does it? ex: function myFunc() { // do things } el.addEventListener(event, myFunc);
Yes, Any time you pass a function declaration as an argument to another function , either named or anonymous function. the become function expressions.
Nice tutorial before appearing for JS interview. I had gone through a few interviews and was asked most of these questions and also them:
1. Spread Operator
2. Bind, Call, Apply in JS
3. Array Questions (deep copy and shallow copy of array using assign;also map property used many a times)
4. Ques based on Object Keys
Hope it helps!
(I would appreciate if you make some short video on these topics as well)
0:33 - what is prototypal inheritance
2:58 - what is the difference between function declaration & function expression
4:21 - what is promises and why do we use it
6:43 - setTimeout()
8:23 - what is closure and how do we use it
I feel like he's feeding my brain fresh organic vegetables. You know what I'm talkin about.
No
😂
8 out 10 questions were asked in my interview, after listening to your tutorial , i am pretty confident about everything .thank you so much gurujiii, all the best!! great going !!!
5)When do we use Arrow functions?
Arrow functions make our code more concise, and simplify function scoping and the this keyword.
By using arrow functions, we avoid having to type the function keyword, return keyword (it’s implicit in arrow functions), and curly brackets.
This keyword in arrow functions
A normal function has its this keyword ie the scope of this keyword in normal function is its function.
whereas in arrow fnction, fat arrow does not have its this, fat arrow takes this from its parent function
Which takes us to a conclusion that you should use fat arrow/arrow function when you want to use this of parent function, in case you want to use this of current block/function you should use normal function. for eg take this eg.
//profile is an object
const profile = {
firstName: '',
lastName: '',
setName: function(name){
let splitName = function(n){
let nameArray = n.split(' ');
this.firstName = nameArray[0];
this.lastName = nameArray[1];
}
splitName(name)
}
}
profile.setNmae("vikram sharma);
console.log(profile.firstName)
this code will not give us any output as "this" keyword in normal function will look for its value in the same function only(which is this)
setName: function(name){
let splitName = function(n){
let nameArray = n.split(' ');
this.firstName = nameArray[0];
this.lastName = nameArray[1];
}
, whereas if we use arrow function
const profile = {
firstName: '',
lastName: '',
setName: (name) => {
let splitName = (n) => {
let nameArray = n.split(' ');
this.firstName = nameArray[0];
this.lastName = nameArray[1];
}
splitName(name)
}
}
profile.setNmae("vikram sharma);
console.log(profile.firstName)
This will give the output as vikram, becasue fat arrow automatically sets this keyword to setName ie its parent.
6) What is prototype inheritance?
Every object has a property called prototype, by which you can add methods and properties to it and when you create other objects from these objects, the newly created object will automatically inherit the properties of the parent, not by including in its own properties but instead it uses from its parent.
The way it works is, when you call a particular object or a method it first looks at its own properties if its there and if its not there it will look in its parents properties, therfore this way objects are much lighter.
eg:
let car = (model) => {this.model = model}
car.prototype.getModel = () => return this.model
let toyota = car("toyota")
console.log(toyota.getModel())
ie we inherited model property from our method car in another method getModel by protyping car
7) what is the difference between function declaration & function expression?
console.log(funcD()) ---> function declaration //ie its available to us even before its declaration
console.log(funcE()) ---> error // its saved to a var and will behave like one, moreover it has a variable scope
function funcD()
{
console.log("function declaration")
}
let funcE = function()
{
console.log("function expression")
}
8) what is promises and why do we use it?
We use promises to simplify a callback hell
9) What is setTimeout()?
10) what are closures?
When a func returns another func, the returning function will hold its environment
"Closures are functions that refer to independent (free) variables. In other words, the function defined in the closure 'remembers' the environment in which it was created
let obj = function(){
let i=0;
return {
setI(k)
{
i=k;
}
getI()
{return i}
}}
thank you!
Thanks, almost all above questions were asked in my interview and I had no clue about a few of them and I was rejected, your tutorials are too good for the beginners. keep motivating us... thanks a ton.
Keep on learning Mohd. Learn fundamentals and everything else will fall in place.
you are the best vanilla javascript teacher ive seen them all from paid ones to free ones you are the best one if not the top 3
Thanks for watching :)
omg, last week I literally got asked all these questions except for the prototypal inheritance and the function declaration vs expression thing. I hate to say that at that time I didn't find your video so I wasn't able to answer what a closure was. And they also gave me a tricky settimeout exercise. Anyways, they asked for a second interview and here I go again! Thanks a lot for the info!
what is prototypal inheritance? 0:27
what is the difference between function declaration and function expression? 2:57
what is promises and why do we use it? 4:22
setTimeout() 6:42
what is closure and how do use it? 8:22
I've got an interview next week and these videos are solid interview prep gold. Thank you :)
I watched this tutorial after having watched your other tutorials on Closure, Promise, Call-Apply-Bind, and I have to tell you all three questions puzzled me in my latest interview - so thank you again for sharing these nuggets and helping us better understand problems that puzzled us in the first place!
Great videos (both of them), thank you. Having said that, I could spot one mistake. At 4:00 its stated that to pass a function as an argument to another function we would have to use a function expression. This is not true, we can pass a function declaration as well.
Also, it is worth mentioning that function declarations are hoisted whilst function expressions are not.
Hoisting is already mentioned
Also would like to add that Promise actually gets queued up in the microtask queue while setTimeout gets queued up in the callback queue. The prioritization of the event loop is that microtask queue -> callback. Therefore if you try to do a setTimeout before a promise ,let say to fetch some API , a promise will actually get returned first.
I am learning more with your videos...
I gave up reading so many book to learn simple things. Thanks
These days books are not very useful as there are better examples available online. Keep up the good work !
My first JS interview was fun, ya I didn't do well. But when I was asked those questions, I felt that I knew the answers but not able to answer them. The questions include closures, inheritance and ES... That was fun. And now I am getting into JS stuff ... And these videos are helping me. Thanks :)
I feel you . I know most of the time you know the answer however when interviewer asks our mind just freezes and then it freezes more :) Good luck with your interview. Just relax and take your time .
Just wanted to comment that you CAN pass a declared function in as a variable. You give the function a name in the declaration. So in his example, you'd be able to pass funcD into funcE (if funcE accepts arguments), so something like...funcE(funcD) would console log out both strings (again...if funcE calls the argument passed in)
I found these tutorials to be VERY helpful and great interview prep.
Thanks for watching! :)
Awesome video! This is probably the 10th-odd video I've seen of yours and they've always been very clear and easily to follow. Keep up the great work!
Thanks Adam. I am glad you like it. :)
I wasn’t aware that Closure was an actual property that can be accessed. Thank you for showing me this!
I think you have the knack for imparting knowledge - I love it! Cheers.
watched the whole series && learned a lot. thanks!
Hey Buddy, This is the best javascript channel i have seen who covers the topic which are hands on daily javascript programming and The content of this channel is very helpful for beginners as well as mid senior JS developer who is appearning in JS interviews.
I want to say you something that why you dont try some aws and node js advance practices that will be very helpful for the subscribers to understand modern trends.
Thanks For all your help!
Not sure if this is what he meant at @4:01 but it works fine:
function one() { return 1; }
function runAndLog(f) { console.log(f()); }
runAndLog(one);
yes because when you pass function declaration as an argument it converts to a "named function expression" . I would work fine in this case but there can be scoping issues like following would also work but it shouldn't
function runAndLog(f) {
console.log(f());
}
runAndLog(one);
function one() {
return 1;
}
Few of the Questions asked in my Interviews so far.
1. [x,y,z] = "abc"; Console.log([x,y,z])
2. Why does Javascript have both null and undefined? What was the need to retain undefined?
3. for(var i =0; i
These are some good questions. Were you able to answer them?
I wasn't able to answer most of these. Few Questions mentioned in your video were also asked in the Interview. Your videos has helped me understand JS better. Thank You.
Around 04:10 I'm 99% sure I understand what you're getting at but an example would be really helpful to solidify the explanation
Awesome video and explanation (part 1 as well). It really helps me with the interviews! Thank you very much!
Thank you for your help. I wish I would have seen this before my last interview. I like how clear and concise you are with your explanations but I wish that your microphone was a little bit louder.
my first js interview went terrible as i didn't watched this video but will go for more as it gave me some nice experience
Hast's off man, you doing really well job.
Also add because I have faced multiple time this quest. "Event Bubbling" & "Event Delegation".
I have tutorial on Event Bubbling also if you want to check it out. Good luck with your interviews.
Yeah got it, nice one (y) (y)
Aweosme...just love your videos...they are very helpful...
@techsith, 4:10, I think you can pass function declaration as an argument, should work. Not sure if I understood you properly, because the following code works,
function count(val){
console.log(val);
}
var t = function(func){
func(5);
}
t(count); // prints `5`
In JavaScript, functions are high order objects.
As soon as you pass function desecration to another function it becomes function expression becase it hold inside a variable inside the function. so its no longer function declaration.
@@Techsithtube yes, as a variable in the function agruments per se. I think it would be worth mentioning that, else people might think it is not possible, or it would throw an error if we pass a reference to a function declaration as an argument. :)
Thanks for posting this video and It's clear and depth ...please provide more videos of Js and Angular
Thanks for this video. Yes, closure is a very important topic of Javascript. I have faced it two times.
you are a god techsith... thank you
:) Hanna, thanks for an awesome comment.
I really like this guy's videos, seems very real life experience and good examples to illustrate the topic.
Thank you..missed call Bind and Apply in this video..frequently asked and we struggle to answer that..anyhow i checked it in advanced javascript tutorials
Yes that is true. I have been asked that many times. Thanks for pointing out.
Well... he has tutorials on them and also has a video discussing their implementations... So, go check it out
I am a big fan of urs, You explain things in very efficient way, One question "How does JS manage multiple events in parallel, like click, input, etc. when it is interpreted & single threaded?"
JavaScript is more optimal in that sense. it is single threaded and the way it works is very simple. anything that is synchronous will get on the stack and gets executed one by one. However anything asynchronous gets on a queue where it waits for its turn. and when its ready to be executed it waits for the stack to be empty . I have a tutorial on settimeout where i explain it more clearly. ALso look at tutorial for webworkers. which allows you to simulate multithreading with some restrictions.
It is very helpful, I was asked some of the questions already. Thanks!
Thanks, man, you showed the best example for closures understanding, nice job!
This is a hidden treasure I have found. Very informative and nicely put. you are a gem of a person and I really liked the way you have explained the topics with ease.. kudos and keep up the good work and I’ll look forward to more videos from you.
I have an interview tomorrow and mostly about javascript. I have a feeling that I will fail it but many thanks that I found and watched your video. Very helpful!!
how many questions ask from this 2 videos??
I have also tomorrow an interview and I have not much knowledge about javascript is these 2 videos of interview preparation enough ??
@@shevangpatel3537 Good luck to you! My interview question is about React though...
@@cloriswang2576 my interview is about angular still I have a time please advice me which sourse i prefer to crack the interview
Awesome tutorial. Thanks
Glad it was helpful!
Really clear explanation, Really it helps me to clear my concept
I am glad it helped. Thanks for watching ! :)
Thanks for sharing this video... From these 10 questions, i got 8 questions in my interviews. Please share more questions from javascript and angular.
Here is a playlist with more interview questions. ua-cam.com/play/PL7pEw9n3GkoWn5TcqAdmSzXcvC3d_tfAh.html
Thank you ,this series is great ,please keep building
Hats off to your patience. What a great and simple way to explain things. Thanks sir.
:) Thanks for watching!
Great work sir 👏👏👍
Very useful. Thanks
for a junior dev interview i have been asked what are media queries and how to you code them, == vs ===, and var vs. let vs. const :)
Yes there are very common questions. Everyone should prepare for that. :)
Would like to see video on design patterns in JavaScript.
And what to know React is based on which design pattern.
Phenominal! Thank you!!
Hi there I am wondering if we can compare the concept of "promises" in javascript to be similar to "delegates" in C#? Are they the same thing? In C#, Delegates are function pointers which are useful for callbacks and checking the current status of another running function while within one. They allow you to pass methods as objects. I am wondering if the two concepts are similar.
Surprisingly I never knew about either of these before these last few months, so I have been trying to use delegates in C# but mostly in toy problems so far. I am struggling to understand practical usage for these despite watching and reading many things.
I have not used delegates in c# so I cant comment on that.
No. Delegates in C# are roughly treated as function pointers. Promise api is very different kind of pattern to do async programming and to provide an easier interface for method chaining.
Am I clear?
Delegates on the other hand
Great questions! I’d like to suggest switching to a dark theme for your IDE. Watching this on a large display, your editor is just a wall of white light and difficult to read. Thanks for your videos!
I have already switched for newer videos. Thanks for watching!
excellent explanation on prototypical inheritance! thanks
By convention, constructor functions meant to be used with new are named with starting Capitals. So I believe it's better to name car at 2:05 as Car
That is true.
I subscribed, your way of explaining is very good and relaxing
Thank you Ismail for subscribing!
Thanks a lot for feeding us with the Javascript knowledge and preparing for interviews.
It's my pleasure
To 4:00 here is example of using function declarations and function statement as a callback to funcktions :
jsbin.com/cohozaciwa/edit?js,output
Patryk Janik exactly my question too. It would be helpful if this was answered.
Thanks for your video! It's very useful. Could you please enable your subtitles caption just as other videos you did before? Thank you so much!
Ledies and gentlemens. he is a good teacher. Yesssss??!
You are great sir...
Great explaination!!
Simple & crisp.. :)
Keep going..
Thanks for posting this video it is very helpful for beginners....:-)
Thanks for watching!
Thanks for the nice tutorial, but I wish the answers were displayed on a slideshow so we could take notes easily.
In last example you returned an obj with 2 functions (setI and getI) that didn't had the function keyword ih their declaration. I honestly thought that wouldn't work! Thanks for the tutorial.
stackoverflow.com/questions/32404617/how-does-this-object-method-definition-work-without-the-function-keyword for those to which this is new.
best explanation for closure
i am big fan of u and thanks for vedeo, please post videos like this. Gain knowledge and confidence at same time. subscribed:)
It is very useful and please provide oops concepts of javascript sir thankyou for helping us in this way
at the 4:00 examples difference between function declaration & function expression ; IF you used a VAR instead or a LET for funcE,
instead of throwing an error wouldn't it show as a undefined for funcE just like it did for funD?
No, it would be the same. That 'undefined' was a 'return value' from the console.log
And funcE variable would still be unassigned, so it will give error that undefined is not a function (I think so)
Thanks for the video. The example you used for prototypal inheritance was actually the function definition using prototypes. There is no child parent relation anywhere. Correct me if I am wrong.
Its called function constructors. Base class and subClass relationship is established using prototype chain. I actually have series on Object Oriented JavaScript where I explain this in more detail. Please check it out.
The channels name is On Point
4:10 I'm not sure why you said in the video we can't pass function declaration into another function? If we declare a function we can pass it as an argument to another function.
Very good video. One can get a positive attitude with it. Great job my friend.
Thank you satyen , I just released a new video on more interview questions do check it out.
Great job
Has the best interview advice from the back of the video.
v helpful... can i request you to pls do a video on generators that is tied in to a practical use case... a lot of the tutorials on generators seldom go beyond explaining the syntax... thanks again for producing JS content
Generators will be replaced with async/await in ES7 which has much easier syntax. I recommend to look into it. It will replace the current promise pattern too (.then .catch).
this video series is awesome
Thanks for Thanks for watching.
I think you should make a video explaining about Promises in detail.
I do have a video specifically on promises. Do check it out.
Awesome video :) Thanks!
Function Declaration type of function can be passed around with proper scopes. I tried this with window scope for now
Just one note: It is considered good practice to name constructor functions with an upper-case first letter.
Thank you for valuable stuff :)
This channel is very helpful. I did not expect it to be this good given that bad meme use for thumbnails.
With memes I try to create a theme. Let me know your opinion on what kind of meme you feel are good so I can improve.
Honestly I would not use them at all. They are old memes that take any seriousness of content away. I would just find a logo. You already got a brand with the color and font used. javaScript call apply and bind for example looks so nice compared to ones with rage memes
But if they work for you then ignore my opinion. It is just another opinion on the internet. Wish you the best :)
Sorry if that came out the wrong way btw. We all forget there is someone on the other side of the screen. Loved the content so keep it up!
Sir Great video but please improve the Audio Quality.
Thanks so much for sharing your knowledge....Awesome !!!
You're so amazing, so clear
What do you think the future holds for Angular? I have tried both Angular and React and Angular comes more natural for whatever reason. With this whole patent thing, could we see more people turn to Angular? I know that Vue is the newest and hottest framework right now but still....
I have have used both as well and Angular also feels natural to me. There are companies who would go for it because its a complete solution . So I think it will continue to do good event with all these other frameworks around it.
thanks for this. Really threw me that getter & setter methods don't need 'function' keyword in ES6. might be worth mentioning that.
yes that is true. I am going to create a third part of this series where I will mention that. Thanks for pointing it out.
Super clear, thank you
Glad it helped!
11:31 life lessons learned from admiral Ackbar.
You can pass a function declaration as an argument to another function though.
function innerF() {
console.log('I ran!');
}
function outerF(inner) {
let a = inner();
}
outerF(innerF);
// 'I ran!'
as soon as you put parentheses around the function declaration it becomes function expression :)
( function innerF() {
console.log('I ran!');
})
I did not know that. Thank you. So by putting parentheses around the function you did, say like you do with an IIFE, I understand that this is a function expression, but what I don't understand is how calling a function created as a function declaration inside another function makes the inner function a function expression. For example, if I define a function declaration and then pass it in as a callback in an event listener, it doesn't become a function expression, does it?
ex:
function myFunc() { // do things }
el.addEventListener(event, myFunc);
Actually looking at this I see what you mean now.
Yes, Any time you pass a function declaration as an argument to another function , either named or anonymous function. the become function expressions.
Thank you very much, Sir.
Nice explanations. Thank you.
Thanks for the video! Very enlightening!
You are really great. Your sessions are really informative. :)
I am glad you learnt something Kartiki.
Thanks a lot, this is as usual very helpful
Very helpful, thank you.
Well explained...keep posting sir :)
Thanks for watching!:)
superb videos.... i just love it
Thanks for watching Subbu!
Function declaration and expression can pass to another method