<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Monishadhanasekar</title>
    <description>The latest articles on DEV Community by Monishadhanasekar (@monishadhanasekar).</description>
    <link>https://dev.to/monishadhanasekar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F799879%2Fa37d7bab-20ca-4681-b43f-cc598b3ed15b.png</url>
      <title>DEV Community: Monishadhanasekar</title>
      <link>https://dev.to/monishadhanasekar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/monishadhanasekar"/>
    <language>en</language>
    <item>
      <title>Objects and its internal representation in javascript</title>
      <dc:creator>Monishadhanasekar</dc:creator>
      <pubDate>Thu, 20 Jan 2022 08:40:05 +0000</pubDate>
      <link>https://dev.to/monishadhanasekar/objects-and-its-internal-representation-in-javascript-kpb</link>
      <guid>https://dev.to/monishadhanasekar/objects-and-its-internal-representation-in-javascript-kpb</guid>
      <description>&lt;p&gt;Objects are important data types in javascript. Objects are different than primitive datatypes (i.e. number, string, boolean, etc.). Primitive data types contain one value but Objects can hold many values in form of Key: value pair. These keys can be variables or functions and are called properties and methods, respectively, in the context of an object.&lt;/p&gt;

&lt;p&gt;Every object has some property associated with some value. These values can be accessed using these properties associated with them.&lt;/p&gt;

&lt;p&gt;var myCar = new Object();&lt;/p&gt;

&lt;p&gt;myCar.make = 'Suzuki';&lt;/p&gt;

&lt;p&gt;myCar.model = 'Altros';&lt;/p&gt;

&lt;p&gt;myCar.year = 1978;&lt;/p&gt;

&lt;p&gt;myCar.wheels = 2;&lt;/p&gt;

&lt;p&gt;After creating myCar object, the value inside the object can be accessed using keys.&lt;/p&gt;

&lt;p&gt;i.e.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;myCar.year&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Output: 1978&lt;/p&gt;

&lt;p&gt;These values can be accessed using brackets notation also.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;myCar[year]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Output: 1978&lt;/p&gt;

&lt;p&gt;The syntax for adding a property to an object is :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ObjectName.ObjectProperty = propertyValue;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The syntax for deleting a property from an object is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delete ObjectName.ObjectProperty;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The syntax to access a property from an object is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;objectName.property        
           //or
objectName["property”]     
           //or
objectName[expression]   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, conclusion and simple definition for Java Script properties is “Properties are the values associated with a JavaScript object”.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object methods
&lt;/h2&gt;

&lt;p&gt;An object method is an object property containing a function definition.&lt;/p&gt;

&lt;p&gt;i.e.,&lt;/p&gt;

&lt;p&gt;Let’s assume to start the car there will be a mechanical functionality.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function(){return ignition.on}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and so similar is to stop/brake/headlights on &amp;amp; off, etc.&lt;br&gt;
So, conclusion and simple definition for Java Script Object methods is “Methods are actions that can be performed on objects.”&lt;/p&gt;
&lt;h2&gt;
  
  
  Create JavaScript Object with Object Literal
&lt;/h2&gt;

&lt;p&gt;One of easiest way to create a javascript object is object literal, simply define the property and values inside curly braces as shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let bike = {name: 'SuperSport', maker:'Ducati', engine:'937cc'};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create JavaScript Object with Constructor
&lt;/h2&gt;

&lt;p&gt;Constructor is nothing but a function and with help of new keyword, constructor function allows to create multiple objects of same flavor as shown below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Vehicle(name, maker) {
   this.name = name;
   this.maker = maker;
}
let car1 = new Vehicle(’Fiesta’, 'Ford’);
let car2 = new Vehicle(’Santa Fe’, 'Hyundai’)
console.log(car1.name);    //Output: Fiesta
console.log(car2.name);    //Output: Santa Fe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using the JavaScript Keyword new
&lt;/h2&gt;

&lt;p&gt;The following example also creates a new JavaScript object with four properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var person = new Object();
person.firstName = “John”;
person.lastName = “Doe”;
person.age = 50;
person.eyeColor = “blue”;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using the Object.create method
&lt;/h2&gt;

&lt;p&gt;Objects can also be created using the Object.create() method. This method can be very useful, because it allows you to choose the prototype object for the object you want to create, without having to define a constructor function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Animal properties and method encapsulation
var Animal = {
  type: 'Invertebrates', // Default value of properties
  displayType: function() {  // Method which will display type of Animal
    console.log(this.type);
  }
};
// Create new animal type called animal1 
var animal1 = Object.create(Animal);
animal1.displayType(); // Output:Invertebrates
// Create new animal type called Fishes
var fish = Object.create(Animal);
fish.type = 'Fishes';
fish.displayType(); 
// Output:Fishes



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>HTTP 1.1 VS HTTP 2</title>
      <dc:creator>Monishadhanasekar</dc:creator>
      <pubDate>Thu, 20 Jan 2022 07:06:42 +0000</pubDate>
      <link>https://dev.to/monishadhanasekar/http-11-vs-http-2-3e00</link>
      <guid>https://dev.to/monishadhanasekar/http-11-vs-http-2-3e00</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9_FpIUwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vilicnn4048dqt3smv1i.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9_FpIUwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vilicnn4048dqt3smv1i.jpg" alt="HTTP 1.1 VS HTTP2" width="820" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;HTTP/2 improved on HTTP/1.1 in a number of ways that allowed for speedier content delivery and improved user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Binary protocols:&lt;/strong&gt;&lt;br&gt;
Binary protocols consume less bandwidth, are more efficiently parsed and are less error-prone than the textual protocols used by HTTP/1.1. Additionally, they can better handle elements such as whitespace, capitalization and line endings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiplexing:&lt;/strong&gt;&lt;br&gt;
HTTP/1.1 loads resources one after the other, so if one resource cannot be loaded, it blocks all the other resources behind it. In contrast, HTTP/2 is able to use a single TCP connection to send multiple streams of data at once so that no resource blocks any other resource. HTTP/2 does this by splitting data into binary-code messages and numbering these messages so that the client knows which stream each binary message belongs to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server push:&lt;/strong&gt; &lt;br&gt;
Typically, a server only serves content to a client device if the client asks for it. However, this approach is not always practical for modern webpages, which often involve several dozen separate resources that the client must request. HTTP/2 solves this problem by allowing a server to "push" content to a client before the client asks for it. The server also sends a message letting the client know what pushed content to expect – like if Bob had sent Alice a Table of Contents of his novel before sending the whole thing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Header compression:&lt;/strong&gt; &lt;br&gt;
Small files load more quickly than large ones. To speed up web performance, both HTTP/1.1 and HTTP/2 compress HTTP messages to make them smaller. However, HTTP/2 uses a more advanced compression method called HPACK that eliminates redundant information in HTTP header packets. This eliminates a few bytes from every HTTP packet. Given the volume of HTTP packets involved in loading even a single webpage, those bytes add up quickly, resulting in faster loading.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Increased security:&lt;/strong&gt; &lt;br&gt;
Web browsers only support HTTP/2 via encrypted connections, increasing user and application security.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
