Top 10 JavaScript Interview Questions ( Part 2 )

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 320

  • @andriiauziak1178
    @andriiauziak1178 6 лет назад +199

    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

  • @aasthawadhwa3291
    @aasthawadhwa3291 4 года назад +68

    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)

  • @vstvlogs878
    @vstvlogs878 4 года назад +15

    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}
    }}

  • @jbrabec6811
    @jbrabec6811 4 года назад +81

    I feel like he's feeding my brain fresh organic vegetables. You know what I'm talkin about.

  • @tentx652
    @tentx652 3 года назад +12

    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 !!!

  • @MohammadShahid85
    @MohammadShahid85 6 лет назад +30

    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.

    • @Techsithtube
      @Techsithtube  6 лет назад +8

      Keep on learning Mohd. Learn fundamentals and everything else will fall in place.

  • @Albertmars32
    @Albertmars32 7 лет назад +58

    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

  • @dmytrodemydenko
    @dmytrodemydenko 7 лет назад +14

    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

  • @luisl8851
    @luisl8851 4 года назад +3

    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.

  • @arctiggs
    @arctiggs 3 года назад +2

    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)

  • @carolinadelaossa7383
    @carolinadelaossa7383 4 года назад +2

    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!

  • @victorliafook
    @victorliafook 5 лет назад +7

    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.

  • @ErosNicolau
    @ErosNicolau 7 лет назад +1

    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!

  • @AllKindzzzz
    @AllKindzzzz 4 года назад +2

    I've got an interview next week and these videos are solid interview prep gold. Thank you :)

  • @Caio540100
    @Caio540100 7 лет назад +6

    I am learning more with your videos...
    I gave up reading so many book to learn simple things. Thanks

    • @Techsithtube
      @Techsithtube  7 лет назад +2

      These days books are not very useful as there are better examples available online. Keep up the good work !

  • @MissionVivekananda
    @MissionVivekananda 7 лет назад +3

    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 :)

    • @Techsithtube
      @Techsithtube  7 лет назад +7

      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 .

  • @susanjacobs95
    @susanjacobs95 7 лет назад +9

    I found these tutorials to be VERY helpful and great interview prep.

  • @devonmarantz3324
    @devonmarantz3324 6 лет назад +1

    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.

  • @PrabhakarBangalore
    @PrabhakarBangalore 7 лет назад +1

    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?"

    • @Techsithtube
      @Techsithtube  7 лет назад +2

      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.

  • @kanishkshrivastava6462
    @kanishkshrivastava6462 4 года назад

    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!

  • @srikanthalva
    @srikanthalva 6 лет назад +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

    • @Techsithtube
      @Techsithtube  6 лет назад

      These are some good questions. Were you able to answer them?

    • @srikanthalva
      @srikanthalva 6 лет назад

      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.

  • @scarletovergods
    @scarletovergods 7 лет назад +18

    watched the whole series && learned a lot. thanks!

  • @adamgordon862
    @adamgordon862 5 лет назад +2

    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!

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      Thanks Adam. I am glad you like it. :)

  • @everyonesview
    @everyonesview 4 года назад +1

    I think you have the knack for imparting knowledge - I love it! Cheers.

  • @Roarzambimaru
    @Roarzambimaru 2 года назад

    I wasn’t aware that Closure was an actual property that can be accessed. Thank you for showing me this!

  • @sudhansu23
    @sudhansu23 6 лет назад

    @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.

    • @Techsithtube
      @Techsithtube  6 лет назад

      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.

    • @sudhansu23
      @sudhansu23 6 лет назад

      @@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. :)

  • @guptaankit2791
    @guptaankit2791 7 лет назад +8

    Aweosme...just love your videos...they are very helpful...

  • @subhrajyotibehura34
    @subhrajyotibehura34 6 лет назад +1

    Thanks for sharing this video... From these 10 questions, i got 8 questions in my interviews. Please share more questions from javascript and angular.

    • @Techsithtube
      @Techsithtube  6 лет назад +2

      Here is a playlist with more interview questions. ruclips.net/p/PL7pEw9n3GkoWn5TcqAdmSzXcvC3d_tfAh

  • @rajashekhar433
    @rajashekhar433 7 лет назад +7

    Thanks for posting this video and It's clear and depth ...please provide more videos of Js and Angular

  • @arun-ql8nc
    @arun-ql8nc 7 лет назад +6

    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

    • @Techsithtube
      @Techsithtube  7 лет назад +3

      Yes that is true. I have been asked that many times. Thanks for pointing out.

    • @spacewad8745
      @spacewad8745 6 лет назад

      Well... he has tutorials on them and also has a video discussing their implementations... So, go check it out

  • @ashack
    @ashack 5 лет назад +1

    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!

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      I have already switched for newer videos. Thanks for watching!

  • @bettyliu5057
    @bettyliu5057 7 лет назад +3

    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!

  • @shahshishir838
    @shahshishir838 3 года назад

    Thanks for this video. Yes, closure is a very important topic of Javascript. I have faced it two times.

  • @himanshupandeynitcs
    @himanshupandeynitcs 7 лет назад +1

    Hast's off man, you doing really well job.
    Also add because I have faced multiple time this quest. "Event Bubbling" & "Event Delegation".

    • @Techsithtube
      @Techsithtube  7 лет назад +1

      I have tutorial on Event Bubbling also if you want to check it out. Good luck with your interviews.

    • @himanshupandeynitcs
      @himanshupandeynitcs 7 лет назад

      Yeah got it, nice one (y) (y)

  • @22pradeeppathak
    @22pradeeppathak 7 лет назад +1

    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.

    • @Techsithtube
      @Techsithtube  7 лет назад +1

      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.

  • @TheEricapiano
    @TheEricapiano 5 лет назад +1

    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 :)

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      Yes there are very common questions. Everyone should prepare for that. :)

  • @thadeuluz
    @thadeuluz 7 лет назад +1

    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);

    • @Techsithtube
      @Techsithtube  7 лет назад

      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;
      }

  • @ironrose6
    @ironrose6 6 лет назад +19

    11:31 life lessons learned from admiral Ackbar.

  • @nkumar5897
    @nkumar5897 4 года назад

    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.

  • @cloriswang2576
    @cloriswang2576 3 года назад

    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!!

    • @shevangpatel3537
      @shevangpatel3537 2 года назад

      how many questions ask from this 2 videos??

    • @shevangpatel3537
      @shevangpatel3537 2 года назад

      I have also tomorrow an interview and I have not much knowledge about javascript is these 2 videos of interview preparation enough ??

    • @cloriswang2576
      @cloriswang2576 2 года назад

      @@shevangpatel3537 Good luck to you! My interview question is about React though...

    • @shevangpatel3537
      @shevangpatel3537 2 года назад

      @@cloriswang2576 my interview is about angular still I have a time please advice me which sourse i prefer to crack the interview

  • @TaTar88T
    @TaTar88T 3 года назад

    Thanks, man, you showed the best example for closures understanding, nice job!

  • @UKBhramanti
    @UKBhramanti 4 года назад

    Would like to see video on design patterns in JavaScript.
    And what to know React is based on which design pattern.

  • @nikhilsinha2191
    @nikhilsinha2191 2 года назад

    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

  • @joyandlove7710
    @joyandlove7710 6 лет назад +4

    It is very helpful, I was asked some of the questions already. Thanks!

  • @igobortolon
    @igobortolon 4 года назад +1

    Awesome video and explanation (part 1 as well). It really helps me with the interviews! Thank you very much!

  • @Naniy55462
    @Naniy55462 7 лет назад +3

    Thank you ,this series is great ,please keep building

  • @somesbhowmick2082
    @somesbhowmick2082 7 лет назад +3

    Really clear explanation, Really it helps me to clear my concept

    • @Techsithtube
      @Techsithtube  7 лет назад +2

      I am glad it helped. Thanks for watching ! :)

  • @haciendadad
    @haciendadad 4 года назад

    I really like this guy's videos, seems very real life experience and good examples to illustrate the topic.

  • @swanandfulari9692
    @swanandfulari9692 7 лет назад

    Hats off to your patience. What a great and simple way to explain things. Thanks sir.

  • @drwombat
    @drwombat 2 года назад

    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

  • @ianweber7671
    @ianweber7671 5 лет назад +1

    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.

    • @Techsithtube
      @Techsithtube  5 лет назад

      I have not used delegates in c# so I cant comment on that.

    • @radheyvarshney3153
      @radheyvarshney3153 4 года назад

      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

  • @Niloctronic
    @Niloctronic 5 лет назад

    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.

    • @Niloctronic
      @Niloctronic 5 лет назад

      stackoverflow.com/questions/32404617/how-does-this-object-method-definition-work-without-the-function-keyword for those to which this is new.

  • @MCA96
    @MCA96 4 года назад

    Thanks for the nice tutorial, but I wish the answers were displayed on a slideshow so we could take notes easily.

  • @tomino133
    @tomino133 7 лет назад +2

    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....

    • @Techsithtube
      @Techsithtube  7 лет назад

      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.

  • @elfpimp1
    @elfpimp1 7 лет назад +2

    What are your thoughts on this problem solving process:
    1: restate the problem
    2: work through an example and test for edge cases
    3: think about the implementation (Pseudocode)
    4: write the code
    5: test the code with correct input and edge cases
    6: relax at bar after interview if you think you tanked it.. ;0)

    • @Techsithtube
      @Techsithtube  7 лет назад +4

      I would add one more may be around 3, If there are multiple solution than. explain the easiest solution first and say "there might be muliple solutions to this. let me think about it. " and then improve the your work by optimizing it. That would show your ability to improve.
      BTW, I like the last one. :)

  • @IndianinAmsterdam
    @IndianinAmsterdam 6 лет назад +2

    Great explaination!!
    Simple & crisp.. :)
    Keep going..

  • @everydaycode1535
    @everydaycode1535 5 лет назад +1

    excellent explanation on prototypical inheritance! thanks

  • @creanlis
    @creanlis 4 года назад +1

    you are a god techsith... thank you

    • @Techsithtube
      @Techsithtube  4 года назад

      :) Hanna, thanks for an awesome comment.

  • @jyothikethireddy5712
    @jyothikethireddy5712 4 года назад

    It is very useful and please provide oops concepts of javascript sir thankyou for helping us in this way

  • @HameedKhan-mq4ve
    @HameedKhan-mq4ve 3 года назад

    Thanks a lot for feeding us with the Javascript knowledge and preparing for interviews.

  • @coconachos7497
    @coconachos7497 3 года назад +1

    Awesome tutorial. Thanks

  • @ibknl1986
    @ibknl1986 5 лет назад +1

    I subscribed, your way of explaining is very good and relaxing

  • @giorgimerabishvili8194
    @giorgimerabishvili8194 4 года назад +1

    Just one note: It is considered good practice to name constructor functions with an upper-case first letter.

  • @asimgiri4269
    @asimgiri4269 4 года назад +1

    I think you should make a video explaining about Promises in detail.

    • @Techsithtube
      @Techsithtube  4 года назад +1

      I do have a video specifically on promises. Do check it out.

  • @user-zb5jp4ti1d
    @user-zb5jp4ti1d 7 лет назад

    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

    • @MsBijay007
      @MsBijay007 7 лет назад

      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).

  • @SuperAvinash009
    @SuperAvinash009 7 лет назад +9

    Thanks for posting this video it is very helpful for beginners....:-)

  • @ro____hits
    @ro____hits 2 года назад +1

    The channels name is On Point

  • @avinashsorab5026
    @avinashsorab5026 5 лет назад

    best explanation for closure

  • @JeevanBManoj
    @JeevanBManoj 6 лет назад

    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

  • @salesforceWithParamita
    @salesforceWithParamita 2 года назад

    Very useful. Thanks

  • @shellykapoor7331
    @shellykapoor7331 6 лет назад

    Great sir, Why not you start your udemy course till now? And I am the beginner I have started watching your videos 2 days ago. These are unique and strong our fundamental concepts.

    • @Techsithtube
      @Techsithtube  6 лет назад

      I am actually working on a udemy course. Might release it by end of the august.

  • @SSSwain-yl5oi
    @SSSwain-yl5oi 3 года назад

    Sir Great video but please improve the Audio Quality.

  • @anandshenoy9142
    @anandshenoy9142 5 лет назад

    Function Declaration type of function can be passed around with proper scopes. I tried this with window scope for now

  • @dadkinson
    @dadkinson 7 лет назад

    thanks for this. Really threw me that getter & setter methods don't need 'function' keyword in ES6. might be worth mentioning that.

    • @Techsithtube
      @Techsithtube  7 лет назад

      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.

  • @saskirakosyan5268
    @saskirakosyan5268 4 года назад

    Ledies and gentlemens. he is a good teacher. Yesssss??!

  • @vamsireddy9713
    @vamsireddy9713 6 лет назад +2

    Great job

  • @jasonwelsh417
    @jasonwelsh417 6 лет назад

    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!'

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      as soon as you put parentheses around the function declaration it becomes function expression :)
      ( function innerF() {
      console.log('I ran!');
      })

    • @jasonwelsh417
      @jasonwelsh417 6 лет назад

      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);

    • @jasonwelsh417
      @jasonwelsh417 6 лет назад

      Actually looking at this I see what you mean now.

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      Yes, Any time you pass a function declaration as an argument to another function , either named or anonymous function. the become function expressions.

  • @joyvideos1802
    @joyvideos1802 5 лет назад +1

    hi! thanks for the lesson & it would be better that u keep your voice in same rhythm, voice going up & down which is hard to hear

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      Titus, this is a old video when i didnt have good audio device, newer videos have better audio.

  • @ajitjha5149
    @ajitjha5149 3 года назад

    Great work sir 👏👏👍

  • @mathmaticsgun
    @mathmaticsgun 5 лет назад

    Has the best interview advice from the back of the video.

  • @sunflower-i1g
    @sunflower-i1g 7 лет назад

    Thanks a lot, very clear explanations. Could you please make videos on common JS coding challenges given at interviews?

  • @satyenkasturi
    @satyenkasturi 6 лет назад

    Very good video. One can get a positive attitude with it. Great job my friend.

    • @Techsithtube
      @Techsithtube  6 лет назад

      Thank you satyen , I just released a new video on more interview questions do check it out.

  • @13molu
    @13molu 3 года назад

    If we use var instead of let in function expression, hoisting will take place and will show no error.

  • @adnantariq3346
    @adnantariq3346 5 лет назад

    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?

    • @МихайлоЩигол-г1ф
      @МихайлоЩигол-г1ф 5 лет назад +1

      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)

  • @KishoreKumar-qi9pm
    @KishoreKumar-qi9pm 4 года назад

    i am big fan of u and thanks for vedeo, please post videos like this. Gain knowledge and confidence at same time. subscribed:)

  • @webtechknow
    @webtechknow 4 года назад

    You are great sir...

  • @Mirza_Media
    @Mirza_Media 2 года назад

    Phenominal! Thank you!!

  • @codeative
    @codeative 6 лет назад +2

    You're so amazing, so clear

  • @parrot785
    @parrot785 3 года назад

    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.

  • @cheezcola
    @cheezcola 6 лет назад

    This channel is very helpful. I did not expect it to be this good given that bad meme use for thumbnails.

    • @Techsithtube
      @Techsithtube  6 лет назад

      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.

    • @cheezcola
      @cheezcola 6 лет назад

      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 :)

    • @cheezcola
      @cheezcola 6 лет назад

      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!

  • @navjeet2002
    @navjeet2002 5 лет назад

    Nice Thank you.
    Could you explain why the following code is returning undefined.As per "hoisting in javascript" it should return 1 right?
    console.log(a);
    var a = 1;

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      Hoisting just hoist the definition of the variable not the value. when you define a variable but not assign any value to it. it is undefined. that is why it gives you that.

    • @navjeet2002
      @navjeet2002 5 лет назад

      @@Techsithtube understood thanks

  • @patrykjanik1706
    @patrykjanik1706 7 лет назад +4

    To 4:00 here is example of using function declarations and function statement as a callback to funcktions :
    jsbin.com/cohozaciwa/edit?js,output

    • @logicbuffer2162
      @logicbuffer2162 7 лет назад

      Patryk Janik exactly my question too. It would be helpful if this was answered.

  • @balajithangavel5549
    @balajithangavel5549 3 года назад +1

    Function declaration and expression can pass to another method

  • @OhitsmyChoice
    @OhitsmyChoice 5 лет назад

    Prototype example Let keyword is used, but its scope is witin block, so y it was used outside block (let car),

  • @parmarav1
    @parmarav1 5 лет назад

    Thanks for the tutorial. Can you please provide a tutorial on using Chrome Dev Tools for profiling Js ?

  • @yanivsalman9685
    @yanivsalman9685 7 лет назад +2

    i got the closure and the promise questions only !.. and it was too hard for me. the others i know . thank you so much. i need to practice es6

    • @Techsithtube
      @Techsithtube  7 лет назад

      Yes ES6 is very important these days.

    • @yanivsalman9685
      @yanivsalman9685 7 лет назад

      may i have your permission to write all of those questions and answers and share on github in my repository? so i can remember // it will be public i guess.. so this is why i ask .

    • @Techsithtube
      @Techsithtube  7 лет назад +3

      Yes feel free to share publicly. Knowledge is there for sharing

  • @anantbhat1731
    @anantbhat1731 5 лет назад

    Thanks so much for sharing your knowledge....Awesome !!!

  • @remysilvio
    @remysilvio 6 лет назад +2

    Thanks for the video! Very enlightening!

  • @sayedabdulkarim7086
    @sayedabdulkarim7086 5 лет назад

    You cannot pass a function declaration to another function, you have to use a function expression.Sir, can you give one example
    function foo(x) {
    console.log(x);
    }
    var bar = function(func) {
    func("Hello World!");
    }
    bar(foo);
    function foo(x) {
    console.log(x);
    }
    var bar = function() {
    foo('hello world')
    }
    bar();
    sir its work.

  • @JoeWong81
    @JoeWong81 6 лет назад +1

    Love your videos techsith I just subscribed, keep this series going!!
    please also provide us with data structures/algorithm questions as well.

    • @Techsithtube
      @Techsithtube  6 лет назад +2

      I also have another channel focused on the algorithm and data structure, it's called interviewnest please check it out.