Javascript Coding Interview Questions | Advanced Javascript Interview Questions

Sdílet
Vložit
  • čas přidán 14. 06. 2021
  • Learn 5 must know javascript coding interview questions. This are advanced javascript interview questions that I've got on all interviews during the last 10 years. Don't go to javascript interview without learning this things first.
    ► CHECK MY COURSES - monsterlessons-academy.com/co...
    FOLLOW ME
    ► TWITTER - / monster_lessons
    REFERENCES
    ► Source code - github.com/monsterlessonsacad...
    ► This is Javascript - • Learn Javascript Funct...
    RECOMMENDED VIDEOS
    ► Angular Tutorial for Beginners - • Angular Tutorial for B...
    ► Vue JS Crash Course - • Vue JS Crash Course fo...
    ► React Hooks Full Course - • React Hooks Tutorial f...
    ► Typescript Course for Beginners - • Typescript Crash Cours...
    ► Build a Todo App with Angular - • Build a Todo App With ...
    ► Creating custom select library - • Custom Javascript Drop...
    ► HTML Price comparison - • Practice CSS and HTML ...
    STUFF I USE
    ► My mac mini for home on Amazon - geni.us/mADK6ob
    ► Mac macbook to go on Amazon - geni.us/t0fC
    ► My monitors on Amazon - geni.us/aRoFoR
    ► My mouse on Amazon - geni.us/FTzq
    ► My keyboard on Amazon - geni.us/wAjpl
    ► My Synology NAS on Amazon - geni.us/H9BeFo
    ► My Seagate IronWolf 4TB HDD on Amazon - geni.us/09Hvpm
    ► My external SSD drive on Amazon - geni.us/jg3MGNt
    ► My external HDD drive on Amazon - geni.us/5HCIAX
    ► My monitor arm on Amazon - geni.us/OuX1
    ► My chair on Amazon - geni.us/wGWq
    ► My speakers on Amazon - geni.us/wM4fIn
    ► My coffee machine on Amazon - geni.us/zP1uEbW
    ► My standing desk - www.fully.com/en-eu/standing-...
    Disclosures: All opinions are my own. Sponsors are acknowledged. Some links in the description are affiliate links that if you click on one of the product links, I’ll receive a commission at no additional cost to you. As an Amazon Associate I earn a small commission from qualifying purchases.

Komentáře • 41

  • @MonsterlessonsAcademy

    Learn 5 Javascript features that you need to use every day - czcams.com/video/hiLQn4ktjyo/video.html

  • @bogujang9
    @bogujang9 Před rokem +10

    Please mark missleading explanation at 11:42 as it might confuse others. Return is missing.
    Also interesting to mention if you have regular object (not an instance of a class), you actually get undefined with arrow func:
    var a = {
    prop: 'hi',
    a1: () => this.prop,
    a2: function () {return this.prop}
    }
    a.a1() // undefined
    a.a2() // 'hi'

  • @anasouardini
    @anasouardini Před rokem +7

    This works just fine (prints "lll"), because I didn't forget `return`:
    class p {
    constructor (name){
    this.name = name;
    }
    b = function(){
    return this.name
    }
    }
    const c = new p('lll')
    console.log(c.b())

  • @CANIHAZURDREAMSPLS
    @CANIHAZURDREAMSPLS Před 9 měsíci

    I finally know why we need to bind(this) for class components... because otherwise "this" is global context rather than parent context - thank you sir!

  • @johnacsyen
    @johnacsyen Před 3 měsíci

    @11:45, the function version did not have return, which is why is logs to undefined. if return is added to line 9, it also returns 'Fluffy'

  • @antoniozach91
    @antoniozach91 Před 2 lety

    Excellent video! That channel worth more boost! Keep going well man!

  • @petarstaynov5406
    @petarstaynov5406 Před 2 lety +3

    Your example for the context and this is wrong. The normal function returns undefined because you don't return anything from the function. The arrow function returns the pet name because you've written it in a way in which it returns this.name.

  • @cjmaaz
    @cjmaaz Před 3 lety +2

    You explained Closures with one more js topic I was asked in an interview "Currying". I guess this is a bonus hidden tip for this video. 😛

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 3 lety +3

      Actually currying is the question that I like to ask people on interviews (because I'm a functional programming fan) but I didn't get this question often during interviews this is why I didn't include it in the list.

    • @cjmaaz
      @cjmaaz Před 3 lety

      @@MonsterlessonsAcademy Then on that basis I'll get selected in that interview. 😆

  • @TechVarLAB
    @TechVarLAB Před rokem

    thanks!

  • @pgn666
    @pgn666 Před rokem +3

    THRE IS A MASSIVE BUG in 10:17 example. Line 7 misses "return" and only this is why line 16 logs 'undefined' to the console!!!

  • @sandtree
    @sandtree Před 2 lety

    Thanks.

  • @miggu
    @miggu Před 9 měsíci

    it's very hard to do a video like this, thank you. I think functions should be explained in hoisting as they can be invoked before declaring, I know it's one of those js quirks

  • @tianadede349
    @tianadede349 Před 2 lety

    thanks

  • @devilslide8463
    @devilslide8463 Před 3 lety +4

    Regarding class example and „this” binding. You are not returning anything from getSurname function. That is why I think you are getting undefined. If you console log “this” for both functions you should get class context.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 3 lety +1

      Yes, you are correct, you passed the interview :) I forgot to write return there -_-
      P.S. this in function console.log will be undefined.

    • @devilslide8463
      @devilslide8463 Před 3 lety +2

      @@MonsterlessonsAcademy By logging “this” I meant something like this: codesandbox.io/s/nifty-chebyshev-8z1yo Both functions are reporting “this” as class object.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Před 3 lety

      @@devilslide8463 wow actually I expected it to be undefined as in such construction
      someMethod() {
      function foo () {
      console.log(this)
      }
      foo()
      }
      Sorry that I didn't test it properly :(

    • @devilslide8463
      @devilslide8463 Před 3 lety

      @@MonsterlessonsAcademy exactly honestly speaking it was also my expectation:) If we throw out classes and jump to prototypes we will see that clear difference between regular and arrow functions :)

    • @debjyotibanerjee6382
      @debjyotibanerjee6382 Před 2 lety

      @@MonsterlessonsAcademy Its a dangerously beautiful tutorial...

  • @victortochila9642
    @victortochila9642 Před 2 lety +7

    You have an error explaining the difference between arrow and plain function:
    First of all, you used classes, which is really bad for explaining diff between arrow vs regular functions.
    If I add following code to jsfiddle/codesandbox I am getting compiler errors => we should use only methods inside classes.
    But anyway your getSurname method returns nothing, so undefined is the only value you could get.
    If you return this you would get object here, this is some weird behavior of classes which is not obvious again.
    And generally, after your example, it seems like we need to use arrowFunctions for object methods, when the reality is opposite:
    We need to use arrow functions almost everywhere where we want to save current context e.g. callbacks, but for object methods, where we need to use regular functions.

  • @kumailn7662
    @kumailn7662 Před rokem

    you missed the return keyword in function

  • @doniaelfouly4142
    @doniaelfouly4142 Před rokem

    thanks