Q12 Questions related to 'this' keyword | Frontend Interview Questions | Javascript Questions

Поділитися
Вставка
  • Опубліковано 17 лис 2024

КОМЕНТАРІ • 6

  • @sanidhyapanwar8513
    @sanidhyapanwar8513 2 роки тому +1

    Great video sir, it helped me in MCQ round today

  • @sohammondal578
    @sohammondal578 2 роки тому

    In the last example, where we change the innerFunction from non-arrow Function to Arrow Function to get the this.name from parent scope, another way to solve that problem would be to use call/apply/bind. For eg. - innerFunc.call(this). Is it worth mentioning this in the interview? wdyt?

    • @js_cafe
      @js_cafe  2 роки тому

      Hey Soham, Yeah sure we can tell the interviewer about call bind apply, this would definitely add a good impression. If you wouldn't then you can expect follow up question on call bind and apply.

  • @amitkumargupta-
    @amitkumargupta- 2 місяці тому

    07:31 Object does not have a scope

  • @sanjayrajpurohit4045
    @sanjayrajpurohit4045 7 місяців тому

    Also, there is one more way to solve the last question is to, use call, apply, and pass the value of "this" explicitly to the innerFunction.
    innerFunction.call(this);
    innerFunction.apply(this);

  • @abhisheksah1867
    @abhisheksah1867 Рік тому

    great !!