You CANNOT answer this JavaScript question

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

КОМЕНТАРІ • 19

  • @codedamn
    @codedamn  2 дні тому +4

    Codedamn Pro Sale is now live (limited time)!
    Codedamn Pro includes coding labs, challenges, courses, learning paths, AI access, projects, interview kits, and so much more!
    Get 80% discount (limited time): codedamn.com/codeday
    ----
    Some helpful links on Codedamn:
    Pick a 30-day challenge: codedamn.com/challenges
    Start practicing with a coding lab: codedamn.com/problems
    Build a project: codedamn.com/projects
    New full-stack learning path: codedamn.com/learning-path/shubham-fullstack
    All courses and content: codedamn.com/explore
    Once again, if you're learning to code, try Codedamn! Start here: codedamn.com/codeday

  • @shadowslayer2248
    @shadowslayer2248 2 дні тому +13

    Bro creating more content in one week than me changing my clothes. Damn. Keep the industry insights going!

  • @knotratul5106
    @knotratul5106 2 дні тому +16

    This is a lot easier :
    let a = {
    value: 1,
    toString: function() {
    return this.value++;
    }
    };
    console.log(a == 1 && a == 2 && a == 3); // true

    • @arogueotaku
      @arogueotaku 2 дні тому +2

      :D Moral of the story: Using == in JS should be illegal.

    • @fariduzzamaansari1656
      @fariduzzamaansari1656 2 дні тому

      It can work with === as well, if you use Object.defineProperty with a get() that returns incremented value of a global variable.

  • @bhumit070
    @bhumit070 2 дні тому +2

    This algorithm is also known as it_will_work_in_somtime.

  • @FaizanAli-visiontech
    @FaizanAli-visiontech 2 дні тому

    This is your best video ever.

  • @ujjwalaggarwal7065
    @ujjwalaggarwal7065 2 дні тому

    always fun to see multiprocessing magic

  • @tomjerry0796
    @tomjerry0796 2 дні тому +1

    Is this make any vulnerability in a website, like buffer overflow

  • @CodingWork-p1g
    @CodingWork-p1g 14 годин тому

    Sir plz upload a new 2024 full stack web development course in one shot like you uploaded it before

  • @swapnasaritnayak2569
    @swapnasaritnayak2569 2 дні тому

    I guess that is the reason we have atomics ?

  • @wlockuz4467
    @wlockuz4467 2 дні тому

    I hate stupid interview questions like this because they always depend on context. Where is this code being executed? What runtime? What system? What other code has executed before this code? And 100 other whats before you can conclusively give an answer.

  • @girijashankarj
    @girijashankarj 2 дні тому

    I was not sure how to achieve this, but I was sure it might be overriding a callback invocation after value is returned.
    One another way around than toString is valueOf

  • @piotroszko2
    @piotroszko2 2 дні тому +4

    Classic JS chaos

  • @zen.ali238
    @zen.ali238 2 дні тому

    Crazy

  • @Aditya_Vyas
    @Aditya_Vyas 2 дні тому

    Wow