opfflex.blogg.se

Javascript the good parts
Javascript the good parts












javascript the good parts

If the property name is a string literal, a legal js name and not a reserved word, dot notation can be used to retrieve it.

  • Retrieving data can always be done using bracket notation.
  • Property names must be enclosed in quotes if they are not legal or are reserved names.
  • Prototype linkeage allows an object to inherit the properties of another object.
  • A value can be of any value except _undefined. A name can be any string including an empty string.
  • An object is a container of properties.
  • Objects like functions, arrays and objects are "mutable keyed collections."
  • types like number, string are object-like in that they have methods, but they are immutable.
  • javascript the good parts

    It might have to do with the fact that trying to extract the value of a propertu using brackets requires the use of a string for the property name, not plain name).

  • property "names are treated as literal names, not as variable names," (I have no idea what this means.
  • The for in construct (also available in python as well) is present in js and can be used this way:.
  • A block (a group of statements enclosed by squiggly brackets) DOES NOT create a new scope.
  • Strings are immutable and + is used for concatenation.
  • A character can be represented by a single character in a string.
  • Js has an object Math which has methods for manipulating numbers.
  • isNaN( number) is used to determine if a number is NaN.
  • NaN is a number that's not equal to any value including itself.
  • javascript the good parts

    All numbers are 64-bit floating point numbers.I will only focus on the details where js really differs from those languages. Javascript shares many syntactic details with other C-like languages like Java.Other good parts include: loose typing, dynamic objects, an expressive object literal notation.Lambdas were built into the language from the beginning.The book is about the language and not about the DOM or AJAX.

    javascript the good parts

    Crockford suggests using a subset of the language that is entirely made of those good parts, ignoring the rest. It still has its fair share of good parts. Js has many bads parts and design issues.Javascript is a beautiful language buried under a "steaming pile of good intetions and blunders.".1.The Method Invocation Pattern (and the meaning of this).It's not only informative and short, but also a very funny and the writing is very clear and to the point. I would encourage all users of js to read this book. Does JSTGP really need a summary? It's one of the thinnest programming books out there. Notes for future use on Crockford's famed Javascript, the Good Parts! This can be read as a preview of what I think is a worth reading book, or simply used a quick review of important topics discussed in the book.














    Javascript the good parts