Mercurial > js4py
changeset 204:45e7d5e8fa97
Use double backticks for inline code
| author | Radomir Dopieralski <radomir.dopieralski@allegro.pl> |
|---|---|
| date | Wed, 16 May 2012 16:53:27 +0200 |
| parents | 92c876338c31 |
| children | a808230bc5dd |
| files | core-javascript/equality.rst core-javascript/object-tree.rst |
| diffstat | 2 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/core-javascript/equality.rst Wed May 16 16:37:06 2012 +0200 +++ b/core-javascript/equality.rst Wed May 16 16:53:27 2012 +0200 @@ -151,10 +151,10 @@ js> +a === +b true -When the value cannot be converted to a number, you will get a `NaN` value. +When the value cannot be converted to a number, you will get a ``NaN`` value. `NaN` is never equal to anything, even to itself. -Alternatively, you can use the `parseInt` and `parseFloat` functions to convert +Alternatively, you can use the ``parseInt`` and ``parseFloat`` functions to convert strings to number -- their behavior is slightly different, as they will silently ignore all non-number characters in the string. @@ -165,15 +165,15 @@ js> +'3abc1' NaN -Because `NaN` is never equal to anything, even itself, you cannot check whether -you got `NaN` as a result with `==` or `===`. You have to use the `isNaN` function -for that. +Because ``NaN`` is never equal to anything, even itself, you cannot check whether +you got ``NaN`` as a result with ``==`` or ``===``. You have to use the ``isNaN`` +function for that. Compare as boolean ------------------ To convert an expression to a boolean value, it's most convenient to use the -`!` boolean negation operator twice, like this: +``!`` boolean negation operator twice, like this: .. code-block:: javascript
--- a/core-javascript/object-tree.rst Wed May 16 16:37:06 2012 +0200 +++ b/core-javascript/object-tree.rst Wed May 16 16:53:27 2012 +0200 @@ -8,8 +8,8 @@ value = obj.attr # Get the attr of 'a'. obj.attr = value # Set the attr of 'a'. -respectively **set** and **get** the *attr* attribute of the object -*obj*. Inheritance is where an object gets some its attributes from +respectively **set** and **get** the "attr" attribute of the object +``obj``. Inheritance is where an object gets some its attributes from one or other more objects. JavaScript uses an object tree for inheritance. @@ -35,12 +35,12 @@ ^^^ When JavaScript needs to get an attribute value of an object, it first -looks up the attr of the attribute in the object's dictionary. If the -attr is a key in the dictionary, the associated value is returned. +looks up the name of the attribute in the object's dictionary. If the +attribute name is a key in the dictionary, the associated value is returned. -If the attr is not a key, then the process is repeated using the +If the name is not a key, then the process is repeated using the object's parent, grandparent, and so on until the key is found. If -the key is not found in this way then *undefined* is returned. +the key is not found in this way then ``undefined`` is returned. Set @@ -55,7 +55,7 @@ ---- When the interpreter starts up, the **root** of the tree is placed at -*Object.prototype*. (We'll find out later why that location is used.) +`Object.prototype`. (We'll find out later why that location is used.) Every object inherits from the **root**, although perhaps not directly. Here's a simple example:
