<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -40,9 +40,9 @@
 			&lt;key&gt;caret&lt;/key&gt;
 			&lt;dict&gt;
 				&lt;key&gt;column&lt;/key&gt;
-				&lt;integer&gt;25&lt;/integer&gt;
+				&lt;integer&gt;22&lt;/integer&gt;
 				&lt;key&gt;line&lt;/key&gt;
-				&lt;integer&gt;3&lt;/integer&gt;
+				&lt;integer&gt;246&lt;/integer&gt;
 			&lt;/dict&gt;
 			&lt;key&gt;firstVisibleColumn&lt;/key&gt;
 			&lt;integer&gt;0&lt;/integer&gt;</diff>
      <filename>engglog.tmproj</filename>
    </modified>
    <modified>
      <diff>@@ -324,10 +324,115 @@ $(document).ready(myFeature.init);
 	  &gt;&lt;/li
 	&gt;&lt;/ul
       &gt;&lt;/div
+    &gt;&lt;div id=&quot;advanced-javascript&quot;
+    &gt;&lt;h2
+      &gt;Advanced Javascript&lt;/h2
+      &gt;&lt;div id=&quot;references-2&quot;
+      &gt;&lt;h3
+	&gt;References&lt;/h3
+	&gt;&lt;ul
+	&gt;&lt;li
+	  &gt;&lt;a href=&quot;http://ejohn.org/apps/learn/#24&quot;
+	    &gt;Advanced Javascript by John Resig&lt;/a
+	    &gt;&lt;/li
+	  &gt;&lt;li
+	  &gt;&lt;a href=&quot;http://news.ycombinator.com/item?id=846365&quot;
+	    &gt;Hacker News discussion on &lt;code
+	      &gt;this&lt;/code
+	      &gt; keyword&lt;/a
+	    &gt;&lt;/li
+	  &gt;&lt;li
+	  &gt;&lt;a href=&quot;http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/&quot;
+	    &gt;Another post on &lt;code
+	      &gt;this&lt;/code
+	      &gt; keyword&lt;/a
+	    &gt;&lt;/li
+	  &gt;&lt;/ul
+	&gt;&lt;/div
+      &gt;&lt;div id=&quot;function-context&quot;
+      &gt;&lt;h3
+	&gt;Function Context&lt;/h3
+	&gt;&lt;p
+	&gt;&lt;code
+	  &gt;this&lt;/code
+	  &gt; in a a function refers to the context. If a function is defined globally like below, &lt;code
+	  &gt;this&lt;/code
+	  &gt; refers to the global context&lt;/p
+	&gt;&lt;pre
+	&gt;&lt;code
+	  &gt;function katana(){ 
+  this.isSharp = true; 
+} 
+katana(); 
+assert( isSharp === true, &amp;quot;A global object now exists with that name and value.&amp;quot; );
+&lt;/code
+	  &gt;&lt;/pre
+	&gt;&lt;p
+	&gt;However, if it is defined as an object variable like below, it refers to the object&lt;/p
+	&gt;&lt;pre
+	&gt;&lt;code
+	  &gt;var katana = { 
+  isSharp: true, 
+  use: function(){ 
+    this.isSharp = !this.isSharp; 
+  } 
+}; 
+katana.use() 
+assert( !katana.isSharp, &amp;quot;Verify the value of isSharp has been changed.&amp;quot; );
+&lt;/code
+	  &gt;&lt;/pre
+	&gt;&lt;p
+	&gt;The context can be changed by using &lt;code
+	  &gt;call&lt;/code
+	  &gt; on the function&lt;/p
+	&gt;&lt;pre
+	&gt;&lt;code
+	  &gt;var object = {}; 
+function fn(){ 
+  return this; 
+} 
+assert( fn() == this, &amp;quot;The context is the global object.&amp;quot; ); 
+assert( fn.call(object) == object, &amp;quot;The context is changed to a specific object.&amp;quot; );
+
+// Example 2 (using apply)
+function add(a, b){ 
+  return a + b; 
+} 
+assert( add.call(this, 1, 2) == 3, &amp;quot;.call() takes individual arguments&amp;quot; ); 
+assert( add.apply(this, [1, 2]) == 3, &amp;quot;.apply() takes an array of arguments&amp;quot; );
+&lt;/code
+	  &gt;&lt;/pre
+	&gt;&lt;/div
+      &gt;&lt;div id=&quot;using-new&quot;
+      &gt;&lt;h3
+	&gt;Using &lt;code
+	  &gt;new&lt;/code
+	  &gt;&lt;/h3
+	&gt;&lt;p
+	&gt;In the code below, a simple call to &lt;code
+	  &gt;Ninja&lt;/code
+	  &gt; returns the value of the evaluated function, whereas using &lt;code
+	  &gt;new Ninja&lt;/code
+	  &gt; returns the function object.&lt;/p
+	&gt;&lt;pre
+	&gt;&lt;code
+	  &gt;function Ninja(){ 
+  this.name = &amp;quot;Ninja&amp;quot;; 
+} 
+
+var ninjaA = Ninja(); 
+assert( !ninjaA, &amp;quot;Is undefined, not an instance of Ninja.&amp;quot; ); 
+
+var ninjaB = new Ninja(); 
+assert( ninjaB.name == &amp;quot;Ninja&amp;quot;, &amp;quot;Property exists on the ninja instance.&amp;quot; );
+&lt;/code
+	  &gt;&lt;/pre
+	&gt;&lt;/div
+      &gt;&lt;/div
     &gt;&lt;div id=&quot;bloom-filters-in-haskell&quot;
     &gt;&lt;h2
       &gt;Bloom Filters in Haskell&lt;/h2
-      &gt;&lt;div id=&quot;references-2&quot;
+      &gt;&lt;div id=&quot;references-3&quot;
       &gt;&lt;h3
 	&gt;References&lt;/h3
 	&gt;&lt;ol style=&quot;list-style-type: decimal;&quot;</diff>
      <filename>log.html</filename>
    </modified>
    <modified>
      <diff>@@ -244,6 +244,77 @@ $(document).ready(myFeature.init);
 * [Algorithm Design Manual](http://www.amazon.com/dp/0387948600)
 
 
+## Advanced Javascript
+
+### References
+
+* [Advanced Javascript by John Resig](http://ejohn.org/apps/learn/#24)
+* [Hacker News discussion on `this` keyword](http://news.ycombinator.com/item?id=846365)
+* [Another post on `this` keyword](http://justin.harmonize.fm/index.php/2009/09/an-introduction-to-javascripts-this/)
+
+### Function Context
+
+`this` in a a function refers to the context. If a function is defined
+globally like below, `this` refers to the global context
+
+~~~~~~
+function katana(){ 
+  this.isSharp = true; 
+} 
+katana(); 
+assert( isSharp === true, &quot;A global object now exists with that name and value.&quot; );
+~~~~~~
+
+However, if it is defined as an object variable like below, it refers to the
+object
+
+~~~~~~
+var katana = { 
+  isSharp: true, 
+  use: function(){ 
+    this.isSharp = !this.isSharp; 
+  } 
+}; 
+katana.use() 
+assert( !katana.isSharp, &quot;Verify the value of isSharp has been changed.&quot; );
+~~~~~~
+
+The context can be changed by using `call` on the function 
+
+~~~~~~
+var object = {}; 
+function fn(){ 
+  return this; 
+} 
+assert( fn() == this, &quot;The context is the global object.&quot; ); 
+assert( fn.call(object) == object, &quot;The context is changed to a specific object.&quot; );
+
+// Example 2 (using apply)
+function add(a, b){ 
+  return a + b; 
+} 
+assert( add.call(this, 1, 2) == 3, &quot;.call() takes individual arguments&quot; ); 
+assert( add.apply(this, [1, 2]) == 3, &quot;.apply() takes an array of arguments&quot; );
+~~~~~~
+
+### Using `new`
+
+In the code below, a simple call to `Ninja` returns the value of the evaluated
+function, whereas using `new Ninja` returns the function object.
+
+~~~~~~
+function Ninja(){ 
+  this.name = &quot;Ninja&quot;; 
+} 
+ 
+var ninjaA = Ninja(); 
+assert( !ninjaA, &quot;Is undefined, not an instance of Ninja.&quot; ); 
+ 
+var ninjaB = new Ninja(); 
+assert( ninjaB.name == &quot;Ninja&quot;, &quot;Property exists on the ninja instance.&quot; );
+~~~~~~
+
+
 ## Bloom Filters in Haskell
 
 ### References</diff>
      <filename>log.txt</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ce8a818d5d10e2d15507dba891e01bcfe7437bab</id>
    </parent>
  </parents>
  <author>
    <name>Deepak Jois</name>
    <email>deepak.jois@gmail.com</email>
  </author>
  <url>http://github.com/deepakjois/engglog/commit/d2fcce77bef20320cf6c813ff7429a83d8d13a9c</url>
  <id>d2fcce77bef20320cf6c813ff7429a83d8d13a9c</id>
  <committed-date>2009-09-28T10:22:07-07:00</committed-date>
  <authored-date>2009-09-28T10:22:07-07:00</authored-date>
  <message>Adding JS stuff</message>
  <tree>b4cb0a7146419feb8cd6b771c3e4f9d39ef3f540</tree>
  <committer>
    <name>Deepak Jois</name>
    <email>deepak.jois@gmail.com</email>
  </committer>
</commit>
