<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tejas Bontadka on Medium]]></title>
        <description><![CDATA[Stories by Tejas Bontadka on Medium]]></description>
        <link>https://medium.com/@tejas.techo?source=rss-173aed54d626------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L4z9VAjkdFcBoxh-8bHIGQ.jpeg</url>
            <title>Stories by Tejas Bontadka on Medium</title>
            <link>https://medium.com/@tejas.techo?source=rss-173aed54d626------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 03:55:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tejas.techo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Dive deep in the ocean of JS — 2]]></title>
            <link>https://medium.com/@tejas.techo/dive-deep-in-the-ocean-of-js-2-253b9f5591dd?source=rss-173aed54d626------2</link>
            <guid isPermaLink="false">https://medium.com/p/253b9f5591dd</guid>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[copywithin]]></category>
            <category><![CDATA[array-functions]]></category>
            <category><![CDATA[prototype]]></category>
            <category><![CDATA[array-methods]]></category>
            <dc:creator><![CDATA[Tejas Bontadka]]></dc:creator>
            <pubDate>Mon, 15 Jun 2020 18:21:14 GMT</pubDate>
            <atom:updated>2020-06-15T18:37:11.596Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dive deep in the ocean of JS — 2</h3><p>Hey Scripties(one who code Javascript… Hahahahahaha 🤣).</p><p>In the previous blog we understood, “why everything is Object in Javascript”.<br>Please find the below link to visit the previous blog and understand “why everything is Object in Javascript”.<br><a href="https://medium.com/@tejas.techo/dive-deep-in-the-ocean-of-js-1-466df2d93d5b">https://medium.com/@tejas.techo/dive-deep-in-the-ocean-of-js-1-466df2d93d5b</a></p><p>In this blog we will look in to properties and methods of function objects we frequently use.</p><p>Lets look in to properties and methods of <strong>Array.</strong></p><p>Below are the <strong>properties</strong> of <strong>Array:<br>1.</strong> <strong>constructor</strong> : This property returns the constructor function of an Object. i.e, <strong>constructor </strong>property will return the function from where the array you created is <strong>instantiated</strong>, not the function where you declared an array.<br><strong>example</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*FpjyuhW9SB7fTGHdTe_wVw.png" /></figure><p>In the above snippet, we are printing the constructor of array which has been declared in the function called <strong>functionWhichHasArray().</strong></p><p>Okay here we think in two different ways regarding the output.</p><p><strong>First output we might think about:<br> </strong>1. Array <strong>arrayOfNumbers=[1,2,3,4,5]</strong> is declared with in function <strong>functionWhichHasArray().<br> </strong>2. If we create a object of function <strong>functionWhichHasArray(), </strong>then <strong>functionWhichHasArray() </strong>is the constructor which will invoke while instantiating the object. So <strong>arrayOfNumbers.constructor </strong>is nothing but the function from where it is instantiated. Output will be <strong>signature of functionWhichHasArray().</strong></p><p><strong>Second output we might think about:<br> </strong>1. Irrespective of the function where you declare the Array, It will be instantiated from <strong>Array() function object.</strong><br>like <strong>let arrayOfNumbers=new Array(1,2,3,4,5);<br> </strong>2. Then obviously the constructor of array created will be <strong>signature of Array().</strong></p><p>If you are thinking <strong>Second Output,</strong> Then you are in right track.<br>Yes, Output will be the <strong>signature of Array function object</strong>, not the signature of function where you declare the array.</p><p>Output will be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*HJ47sm_ELJ6JTaAKl2rzqA.png" /></figure><p><strong>2.length </strong>: This property will return count of elements in the array.<br>example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*B_B24-Eifq0anLrSU7vvsw.png" /></figure><p>Output for the above snippet is <strong>5.</strong></p><p><strong>3.prototype: </strong>This property lets you add your own properties or methods to <strong>Array() function object</strong>.<br>Prototype is basically a global object which holds good for every Javascript function objects.</p><p><strong>**And keep in mind, you are adding properties/methods to Array(), not the variable you use to declare array.</strong></p><p>example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STJkmAfUTNnRLna4qsP_UQ.png" /></figure><p>Output will be :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*REuT5HJ0aI9AbOy98OGR4A.png" /></figure><p><strong>Now lets look in to methods we have in Array():</strong></p><ol><li><strong>concat()</strong> : This will concat the elements of the two arrays.<br>example:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*h10geop3T4eGSJndGB62aQ.png" /></figure><p>Output will be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*Rj4xAw-d0jJ_o3IAtZAvhg.png" /></figure><p>2. <strong>copyWithin() : </strong>This method copies the elements with in the array to elements of array itself.</p><p>Confused????????…</p><p>Even I was…<br>(Don’t mind, I use lot of ‘…’ in my blog. Because I’m a fan of <strong>Spread Operator</strong> 😆… Will discuss about this guy later…).</p><p>Okay lets come back to <strong>copyWithin().<br></strong>Will revisit the definition once “<strong>This method copies the elements with in the array to elements of array itself.</strong>”</p><p><strong>copyWithin() </strong>function looks like <strong><em>array.copyWithin(</em></strong><em>index from where pasting of elements need to start, index from where copying of elements need to start, number of elements need to copy from the index specified in second parameter</em><strong><em>).</em></strong></p><p><strong>Third parameter is optional.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*QKyjRAo74TKGTokLTWrkFg.png" /><figcaption>Array.copyWithin()</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*UxG1RDIxVF-prLq5kM911w.png" /><figcaption>Output of Array.copyWithin()</figcaption></figure><p>Explanation:</p><p>We have array <strong>[1,2,3,4,5] </strong>&amp; we want to copy the elements of array to the another index of the same array.</p><p>To achieve that we have done something like <strong>array.copyWithin(2,0,2)<br></strong>It means: Copy <strong>2 (third parameter) </strong>elements from <strong>0th (second parameter) index </strong>and paste the copied two elements from <strong>index 2(first parameter) </strong>of an array.</p><p>[1,2,3,4,5] is an array, We copy <strong>2 elements</strong> from <strong>0th index </strong>i.e., <strong>[1,2], </strong>Then we paste the copied two elements([1,2]) from <strong>index 2 </strong>i.e.,<strong>[1,2,1,2,5].</strong></p><p><strong>Note: copyWithin() will copies the elements till the length of the array, Not more that that.<br>i.e., if array.copyWithin(3,0,3) , Then it wont exceed the length of the array to paste the copied values, It will only paste until the length of the array occurs. Output will be [1,2,3,1,2].</strong></p><p>Okay Scripties… Still there are lot of methods to discuss in Arrays.<br>We will cover in next blog.<br>Don’t mind… We need to dive deep.</p><p>Till then,</p><p>Happy scripting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=253b9f5591dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dive deep in the ocean of JS-1]]></title>
            <link>https://medium.com/@tejas.techo/dive-deep-in-the-ocean-of-js-1-466df2d93d5b?source=rss-173aed54d626------2</link>
            <guid isPermaLink="false">https://medium.com/p/466df2d93d5b</guid>
            <category><![CDATA[length]]></category>
            <category><![CDATA[objects]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[arrays]]></category>
            <dc:creator><![CDATA[Tejas Bontadka]]></dc:creator>
            <pubDate>Mon, 25 May 2020 19:52:18 GMT</pubDate>
            <atom:updated>2020-05-25T19:52:18.107Z</atom:updated>
            <content:encoded><![CDATA[<p>Ohhhh…. Objects is it? ‘Yeah I know, But I’m not sure’.</p><p>I think most of us in the same boat. <br>We know what is <strong>Object in Javascript, </strong>But we are not pretty clear about the behaviour of this guy.</p><p>Am I right?..</p><p>If yes…? Then, come on…</p><p>Let’s explore.</p><p>Dear friends, This will be series of blogs where we dive deep in to the concepts of Javascript objects.</p><p>As we all might be working on the latest tech stack of Javascript.<br>It might be React JS,Angular,Node JS and so on…</p><p>We will be pretty familiar with those frameworks and their architecture.<br>Meanwhile we should be also strong enough on the building block of those frameworks. i.e., Javascript.</p><p>Okay… Now we will look in to what is <strong>Object in Javascript.</strong></p><p><strong>What is Object?<br></strong>“In Javascript, Everything is an Object”.</p><p>Okay…. okay…. I can read your mind, You are asking me that “Everybody tell the same, But justify me ?”.<br>Is it?</p><p>Yeah, will try to convince.</p><p>First I will make sure that, Object is nothing but collection of key and value pairs.</p><p>How we denote object ?</p><p><strong>let obj = {name: ‘John Doe’, occupation: ‘Engineer’}</strong></p><p>Above example is a collection of key and value pair, where <strong>name &amp; occupation </strong>are <strong>Keys </strong>and <strong>John Doe &amp; Engineer </strong>are V<strong>alues</strong> for those keys respectively.</p><p>From now we will address <strong>Key </strong>as <strong>Property </strong>of an Object.</p><p>Now if i want the to get the <strong>name</strong> property from the object <strong>obj.<br></strong>we will do <strong>obj.name. </strong>is it?<br>- Yeah. It’s right.</p><p>Now keeping this in mind, we will analyze the things to justify that <strong>everything in JS is an Object. </strong>Will start with Arrays first.</p><p><strong>How Array is an Object?</strong></p><p>If I want to create array of numbers, then I can create with two different approaches.</p><ol><li><strong>let array = [1,2,3,4];</strong></li><li><strong>let array = new Array(1,2,3,4);</strong></li></ol><p>But now if you print these two arrays:</p><p>you get <strong>[1,2,3,4] </strong>as an output.</p><p>Now I have a question like, How can I find the length of the array?<br>- Yeah, very simple right? <strong>array.length </strong>will return the value <strong>4.</strong></p><p>I think now you might get a question like,<br>Hey, I assigned the value <strong>[1,2,3,4] </strong>to the variable <strong>array, </strong>not the object<strong>.<br></strong>Still from where <strong>.length </strong>property is coming from? How that <strong>.length </strong>property holds good for the array I have created? How its returning the exact length of the array that we have created?</p><p>Yeah, Here we go…..</p><p>Actually, Based on the value what you assign, Javascript interprets the type of value and it creates an instance of that function object.</p><p>for eg.,</p><p>if you do, <strong>let array = [1,2,3,4] </strong>implicitly it will be like <strong>let array = new Array(1,2,3,4).</strong></p><p>It means I’m instanciating the O<strong>bject of type Array, <br></strong>Where Array Object has so many properties where some properties assigned with values and some with functions.</p><p>To access the different properties of the Array, we will go with object traversal like.</p><p>Find the length : array.length<br>Filter the data: array.filter<br>……</p><p>It means [1,2,3,4] is an array of numbers instanciated from Array() in the form of object, where that object has some properties to process the Array. like mentioned above.</p><p>Any entity which follows the notation <strong>objectName.property </strong>refers to an object.<br>So for an array I’ll do all such operations using the properties of Array object.</p><p>Hence <strong>Array is an Object.</strong></p><p>We will discuss about other datatypes in later blogs.</p><p>Thank you.</p><p>Happy Scripting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=466df2d93d5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>