<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>D0G0M0</title>
  <link type="text/css" rel="stylesheet" href="thefile.css"/>
  
</head>
<body>
  <nav>
    <a href="http://d0ntg0m0ng.github.io/">Home</a>
    <a href="link">Blog</a>
    <a href="link">Projects</a>
    <a href="link">About Me</a>
    <a href="link">Contact Info</a>  
  </nav>

<section id="blog">
  <h1></h1>
  <h2></h2>
  <h4>6/14/15</h4>

  <section>
  <p>
  This week we started to look at Javascript. It was interesting to see how Javascript differs from Ruby. They are both object orientated so using them were very similar. Both use methods but ruby has way more. 
  </p>
  <p>
Somethings that are similar in both languages is Ruby and constructor function in JavaScript. Both are like blue prints. You can use them to save yourself retyping code because you can fill in the pieces you need while having the template take care of the rest. 
</p>
<p>
Ruby class looks like this
</p>
<pre><code>
class Warrior
  def initialize (name)
    puts name  
  end
end
</code></pre>
<p>
You can then create a class using this blue print:
</p>

<pre><code>
steph_curry = Warrior.new("chef Curry")
</code></pre>
<p>
Then you can call the new class Warrior you made
</p>
<pre><code>
steph_curry
>> "chef Curry"
</code></pre>
<p>
A constructor function is used very similarly in JS. You create the template and then fill in the important parts.
</p>
<pre><code>
Function Cavalier(name) = {
  this.name = name;
}
</code></pre>

<p>
You can then call the function and create a unique version of it.
</p>

<pre><code>
var lebron = new Cavalier("The King")
</code></pre>
<p>
And if you called this instance of function thing it will have the info you filled in.
</p>
<pre><code>
lebron.name
>> "The King"
</code></pre>
<p>
One of the things that differ is classes are not necessarily objects. Ruby has hashes which are basically like javascripts objects. They can both be used the same way so up front they are different but they both can achieve the same thing.
</p>
<p>
As always thanks for taking the time to read this. Let me know what you think about JS and Ruby. Which is your favorite.

</p>
  </section>
</section>


<section id="downunda">
    <footer>
      <a href="https://www.facebook.com/peetear.kim">Facebook</a>
      <a href="https://twitter.com/peetear_kim">Twitter</a>
      <a href="https://plus.google.com/101059813678134655263/posts">Google+</a>
      <a href="https://github.com/d0ntg0m0ng">Gitem</a>
      <a href="https://www.linkedin.com/profile/view?id=327526675&trk=hp-identity-name">Linkedin</a>
    </footer>
    </section>
</body>
</html>