Added: 1 year ago
From: GoogleTechTalks
Views: 34,373
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (25)

Sign In or Sign Up now to post a comment!
  • Oops my finger slipped.

  • thanks for talking about the actual programming language without using alert() boxes within the first 15 seconds. Its a YouTube first!

  • Comment removed

  • it's good to take advantage of the advantage.

  • Misleadingly labelled.

  • puta q pariu

  • what do i do whenever i reload my page is get an error:document.body is null anyone can reply to this and tell me what to do?

  • I know him, he's the crazy guy who does crazy things!

  • I know him, he's the crazy guy who crazy things.

  • thanks 

  • function orgy @44:44

  • function hello() alert("Hello");

  • Strange. He talks about "__proto__" and "prototype". I've been reading JavaScript: The Definitive Reference (O'Reilly, 2007) and it does not mention "__proto__" at all. It explains that "prototype" is a property of ALL objects; whereas Misko states in the video that "prototype" is only defined for functions. In reading "JavaScript: The Good Parts", page 21, the first sentence under the heading "Prototype" says "Every object is linked to a prototype object from which it can inherit properties"

  • are browsergames hackable?

  • Unlike other videos of the Google tech talks I have seen so far, this one was boring. But thanks for sharing the knowledge anyway.

  • Someone please tell him javascript ain't supposed to be Java.

    (dont know why do still program with this shiit...)

  • @Raizdecimal

    "Someone please tell him javascript ain't supposed to be Java."

    I couldn't agree more. He kept calling certain things "problems" where in fact the problem was that he expected JS to behave like Java. His "workarounds" are actually the way it's supposed to be done in JS. I could say the same thing about Java, calling the massive code just to create a binding a problem ... but I don't because there's a reason why it's done that way in Java, & a reason why JS is done differently.

  • I think one thing missing when explaining the Function Closures was that the function will remember its environment in which they were defined.

    So the function binds to its scope at the moment of definition rather then to the current variables and their values found in the scope during execution.

    That's why the counter and prefix behave little bit like static variables.

    I think this makes understanding closures bit more easier... unless I mixed up something terribly

  • @spamero2 Hello there, that is a good point. I was thinking the same way, even though I am new to JavaScript, but I know many programming laguages.

  • Comment removed

  • window isn't the default 'this' in all cases, it's implementation specific, js on the serverside (V8/node for instance) doesn't have a window as global context.

    fix previous comment: o.__proto__ can't always be swapped for o.prototype; if you think of a function as a class, then __proto__ is on the instance and prototype is on the class

  • @webr3

    No, you're right that "this" isn't always "window", but it is the root environment variable whatever that is. For a browser it's windows. for server js frameworks it's "process" or "server" etc ... depending on the framework.

  • @webr3

    "if you think of a function as a class, then __proto__ is on the instance and prototype is on the class"

    I think that's what he meant by saying only functions have prototypes ... all objects have prototypes but only functions requires you to associate the prototype.__proto__ with the .prototype of the class. I think he spent way too much time of __proto__ since the "new" constructor takes care of it for you and it's better practice to avoid __proto__ due to dependencies.

  • notes

    spec for 'JS' is ECMAScript-262 v3 (doesn't include DOM etc)

    everything is 'like' and Object (not everything *is* an Object)

    instanceof ClassName works like any other language.

    o.__proto__ can be swapped for o.prototype

    js is not statically typed lang

    first arg of .call() is 'this' instance to call it function on

    use ParentClassName.call( this, args ) to call parent constructors.

    + is concatenation operator on strings

    semi colon terminations are not specifically needed, compiler auto adds

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more