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

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

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

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

    Great video sir, it helped me in MCQ round today

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

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

  • @amitkrgupta094
    @amitkrgupta094 2 месяца назад

    07:31 Object does not have a scope

  • @abhisheksah1867
    @abhisheksah1867 Год назад

    great !!