title: Protractor "by.css()" vs "$()" Dollar Sign vs "$$()" 'Bling Bling'
body: <p>I don't really understand what the $ and $$ commands are for. I thought they are just a replacement for 'by.css' but why the $$? </p>
  
  <pre><code>&lt;element id = "eId"&gt;&lt;/element&gt;
  </code></pre>
  
  <p>I thought, that given the above, these would be equivalent:</p>
  
  <pre><code>element(by.css('#eId'));
  </code></pre>
  
  <p>and</p>
  
  <pre><code>element($('#eId'));
  </code></pre>
  
  <p>However, the first one works and the second doesn't. Why, what's the difference between the three?</p>
  
  <p>The <a href="https://angular.github.io/protractor/#/api?view=build$">docs</a> are of little help. They seem to imply that "$" is for chaining only, e.g. <code>element(by.css('#eId')).element($('#childId'));</code> or "Select the first element, and then select the second element within the first element.' However, I have seen examples with $ being used to select the first element.</p>
  
  <p>Anyway, that's a lot of text for "What are the differences between the three (by.css, $, and $$)?" </p>