5

I understand JavaScript but I cannot for the love of fucking JavaScript Zeus understand how the fuck all those front end technologies work. Maaaaaaaan I suck at my job.

Comments
  • 0
    Which one in particular?
  • 1
    function Asd() {
    this.title = "hello";
    }

    Asd.title = "macaroni";

    Asd.say = () => console.log(this.title);

    Asd.prototype.say = function() {
    console.log(this.title);
    }

    const thing = new Asd();

    setTimeout(thing.say, 1000)

    // What gets printed?
  • 0
    @Froot Now there are some faster way to get a random string, you know that right?
  • 1
    @Commodore What? 😄
  • 1
  • 0
    @Froot well I mean, that piece of code is so confusing it basically amounts to returning a random string 😋

    @Archeelux oh now I'm intrigued. With everyone praising vue's documentation, I didn't expect this. Care to elaborate?
  • 0
    @Commodore hehe. It's a good snippet to test if someone really knows JS. Has some under the hood things in there and some added confusion 😀
  • 0
    @oreru you mean "hello"? Nope 😃

    Edit: I should have chosen better strings 😃
  • 0
    @oreru yeah 😃
    Edit: do you now know what it returns?
  • 0
    @oreru yeap. undefined or if window.title exists then that 😃

    Btw it has nothing to do with the DOM. It's how 'this' reference works 😃
  • 0
    @oreru what do you mean by that?
Add Comment