Jonathan Fine avatar Jonathan Fine committed b8fe43e

objects.rst: Editorial revisions. Now good enough.

Comments (0)

Files changed (1)

source/objects.rst

    In JavaScript you won't get a KeyError (or IndexError).  Instead,
    you get **undefined**.
 
+In practice, JavaScript left to itself rarely throws an error.  It
+most commonly happens with code such as
+
+.. code-block: javascript
+   
+   obj_a.method(args)
+   obj_b.name
+
+where respectively *obj_a.method* and *obj_name* are undefined.
+
 
 Attributes
 ^^^^^^^^^^
    .. code-block:: javascript
 
       x = a.b(arg1, arg2, arg3)
-      tmp = 'b'; x = a[b](arg1, arg2, arg3)
+      tmp = 'b'; x = a[tmp](arg1, arg2, arg3)
 
    are equivalent.
         
+   But note also that 
+
+   .. code-block:: javascript
+
+      x = a.b(arg1, arg2, arg3)
+      tmp = a.b; x = tmp(arg1, arg2, arg3
+     
+   are sometimes completely different.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.