Skip to content

Instantly share code, notes, and snippets.

@bethsecor
Created March 20, 2016 23:44
Show Gist options
  • Save bethsecor/e432a16113722cf63756 to your computer and use it in GitHub Desktop.
Save bethsecor/e432a16113722cf63756 to your computer and use it in GitHub Desktop.
Discuss Speaking JavaScript, especially following chapters here:

Chapter 3: The Nature of JavaScript

  • "And you can directly create objects, without creating an object factory (e.g., a class) first." I never thought about this until now.
  • "It fails silently." Yikes!
  • "it has no block-scoped variables." I thought let allowed you to declare a variable within the scope of a block?
  • What do you expect for a language that was written in 10 days? It's not perfect!

Chapter 15: Functions

  • I like the explanation of the difference between parameters and arguments.
  • Hoisting seems very odd to me, when would you call a function before it's declared?
  • I really like this: "apply() is useful whenever a function accepts multiple arguments in an array-like manner, but not an array."

Chapter 16: Variables: Scopes, Environments, and Closures

  • The "immediately invoked function expression" seems like a messy way to scope a variable.
  • IIFE with parameters shorthand is not very readable.
  • global variables are bad.
  • I remember Steve talking about polyfills in a GDI class once. Interesting that they need to check for global variables.

Chapter 17: Objects and Inheritance

  • Dot operator is pretty cool.
  • Interesting that deleting properties of objects affects the optimization of performance.
  • 'use strict' is starting to seem like something you should always use to avoid the 'pitfalls' of javascript.
  • Unclear when you would want to do this: jane.sayHelloTo.call(jane, 'Tarzan');
  • bind() will make sure you don't lose connection with a scoped variable, but it will create a new function.
  • It's cool javascript will let you protect objects.
  • The section on contructors would have been nice to read before doing the Leap javascript exercism.
Some questions to start discussion:

Which sections were interesting?

  • Chapters 3 and 15 were a nice overview.

Which sections did you totally skim?

  • Environment section in chapter 16.
  • Many, many parts of chapter 17.

Do you think the reading was valuable?

  • Some of it for sure! Some of it I don't forsee the relevance yet.

Which topics were notably confusing?

  • Environments and closures. The graphs made it worse.
  • Prototypes, sort of.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment