<?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 Rasel Hossain on Medium]]></title>
        <description><![CDATA[Stories by Rasel Hossain on Medium]]></description>
        <link>https://medium.com/@raselhossainy52?source=rss-ddc999966870------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7trLGaSOr7_mzI1BHycHLA.jpeg</url>
            <title>Stories by Rasel Hossain on Medium</title>
            <link>https://medium.com/@raselhossainy52?source=rss-ddc999966870------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 05:07:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raselhossainy52/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[#Day 4: Methods, Computed And Watch Property || 30 Days of Vue]]></title>
            <link>https://medium.com/vue-expert/day-4-methods-computed-and-watch-property-30-days-of-vue-84c1e30007bb?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/84c1e30007bb</guid>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 18:26:47 GMT</pubDate>
            <atom:updated>2021-08-24T18:26:47.837Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*GIEiDCSeUOJiHHieqeIW_w.png" /></figure><p>Today we’ll take a look at the computed property, method, and watcher</p><h3>Methods</h3><p>We already use the method in previous articles. Methods are especially useful when you need to perform an action. Look like this.</p><pre>&lt;button <a href="http://twitter.com/click">@click</a>=&quot;handleClick&quot;&gt;Click&lt;/button&gt;</pre><p>Here “handleClick” will call when the element is clicked. A method is just a function where you can pass the value as a parameter, return a value, and many things you can do like a pure JavaScript function.</p><p>Let’s see some examples of Vue methods.</p><p>let’s see some examples…</p><pre>HTML :<br>{{reverseData}}<br>&lt;button v-on:click=&#39;reverseText&#39;&gt;Change User&lt;/button&gt;</pre><pre>main.js<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;RaselOfficial&quot;,<br>            reverseData:&quot;&quot;<br>        }<br>    },   <br>    methods:{<br>        reverseText(){<br>            console.log(&quot;hi&quot;)<br>            this.reverseData= this.user.split(&quot;&quot;).reverse().join(&quot;&quot;)<br>        }<br>    } <br>})</pre><p>This “textReverse” method is just revers a string.</p><p>In the method, if you want to access data property then we have to use this keyword before the data property</p><h3>Computed Properties</h3><p>A computed property is used to declaratively describe a value that depends on other values. It’s a property that calculates and returns a value. Computed properties are defined in the “computed” property of the Vue Component. And you can directly bind the computed property data in the template/HTML using “{{}}”</p><pre>computed:{<br>}</pre><p>Let’s reverse a string using the Computed property</p><pre>HTML :<br>{{reversText}}</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;RaselOfficial&quot;,<br>        }<br>    },<br>    computed:{<br>        reversText(){<br>            return this.user.split(&quot;&quot;).reverse().join(&quot;&quot;)<br>        }<br>    }<br>})</pre><p>In the computed property the “reverText” value is dependent on the “user” data property. The key difference to using computed properties is that computed properties are cached based on the dependencies they depend on.</p><p>Here I highlight the main differences between using “methods” and “computed” properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*pBS5JRub6gGSRnWB8UKrzQ.png" /></figure><h3>WATCHERS</h3><p>The watch property in Vue will work when the specific data changes.Watch property take to value as a parameter 1.newValue 2.oldValue</p><p>For example, we have a count data property. Now we want when the count value will be more than 5 then we want to alert something, and at the same time, the count data property value will be 0.</p><p>Here to detect count value changes, we need “watch” property</p><p>So let’s see it…</p><pre>HTML :<br>{{count}}<br>&lt;button <a href="http://twitter.com/click">@click</a>=&quot;handleCount&quot;&gt;Click&lt;/button&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            count:0,<br>        }<br>    },<br>   methods:{<br>       handleCount(){<br>           this.count+=1;<br>       }<br>   },<br>   watch:{<br>       count(newValue,oldValue){<br>           if (newValue&gt;5){<br>            alert(&quot;count is more then 5&quot;)<br>            this.count=0;<br>        }<br>    }<br>   }<br>})</pre><blockquote>remember the watch property name and data property name should be the same when you want to use the watch property</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84c1e30007bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vue-expert/day-4-methods-computed-and-watch-property-30-days-of-vue-84c1e30007bb">#Day 4: Methods, Computed And Watch Property || 30 Days of Vue</a> was originally published in <a href="https://medium.com/vue-expert">Vue Expert</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#Day 3 : Vue Directives || 30 Days of Vue]]></title>
            <link>https://medium.com/vue-expert/day-3-vue-directives-30-days-of-vue-b98797aec521?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/b98797aec521</guid>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 18:26:07 GMT</pubDate>
            <atom:updated>2021-08-24T18:26:07.549Z</atom:updated>
            <content:encoded><![CDATA[<h3>#Day 3 : Vue Directives || 30 Days of Vue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*GIEiDCSeUOJiHHieqeIW_w.png" /></figure><p>Today we are going to talk about Vue-Directives.</p><p>Here are some popular Vue-Directives that are listed down.</p><h3>v-text :</h3><p>Instead of using interpolation, you can use v-text. It performs the same job.</p><pre>HTML :<br>&lt;h1 v-text=&quot;user&quot;&gt;&lt;/h1&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;Rasel&quot;,<br>        }<br>    },    <br>})</pre><h3><strong>v-once:</strong></h3><p>for example, you want to bind a name property using interpolation in your template. Now when the name property updates, the view also updates. But v-once doesn’t update the changed value.</p><pre>HTML :<br>&lt;h1 v-once&gt;{{user}}&lt;/h1&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;Rasel&quot;,<br>        }<br>    },    <br>})</pre><h3><strong>v-html :</strong></h3><p>when you want to show data with HTML, that you can use v-html.</p><pre>HTML :<br>&lt;div v-html=&quot;user&quot;&gt;&lt;/div&gt;</pre><pre>main.js<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;&lt;h1&gt;Rasel&lt;/h1&gt;&quot;,<br>        }<br>    },    <br>})</pre><h3><strong>v-bind :</strong></h3><p>If you want to update attributes, then you can go through with the v-bind. You can also bind attributes with (:) colon.</p><pre>HTML :<br>&lt;img v-bind:src=&quot;img&quot; alt=&quot;&quot;&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;&lt;h1&gt;Rasel&lt;/h1&gt;&quot;,            img:`<a href="https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg%60">https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg`</a><br>        }<br>    },    <br>})</pre><h3><strong>v-model</strong></h3><p>The v-model is used when you want tow way bind. It is popular to use in the form. When the user wants to change the form data, it also changes the Vue data property.</p><pre>HTML :<br>&lt;form&gt;<br> &lt;input type=&quot;text&quot; v-model=&quot;user&quot;&gt;<br>&lt;/form&gt;</pre><pre>&lt;h2&gt;Output: {{user}}&lt;/h2&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;&quot;           <br>        }<br>    },    <br>})</pre><h3><strong>v-if :</strong></h3><p>Oftentimes, We need to render a component or an element conditionally. For that, we can you v-if.</p><pre>HTML :<br>&lt;h1 v-if=&quot;isMorning&quot;&gt;Hello World&lt;/h1&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            isMorning:true          <br>        }<br>    },    <br>})</pre><h3>v-else :</h3><p>It does not expect any expression. To use v-else, we then must have v-if previous. Here basically maintains a chain *v-if — -v-else</p><pre>HTML :<br>&lt;h1 v-if=&quot;isShow&quot;&gt;Good Morning&lt;/h1&gt;<br>&lt;h2 v-else&gt;Good Evening&lt;/h2&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            isMorning:true          <br>        }<br>    },    <br>})</pre><h3>v-else-if:</h3><p>Same thing as v-else.The previous sibling element must have a v-if. It also maintains a chain *v-if — -v-else-if — -v-else.</p><pre>HTML :<br>&lt;h2 v-if=&quot;isMorning&quot;&gt;Good Morning&lt;/h2&gt;<br>&lt;h2 v-else-if=&quot;isEvening&quot;&gt;Good Evening&lt;/h2&gt;<br>&lt;h2 v-else&gt;Goodbye&lt;/h2&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            isMorning:false,<br>            isEvening:false       <br>        }<br>    },    <br>})</pre><h3>v-for :</h3><p>List rendering is one of the most commonly used practices in front-end development. In Vue to iterate element, you can use this special syntax <strong>(v-for=”alias in expression”)</strong>.To force it to reorder element, you should provide an ordering hint with (:key)</p><pre>&lt;ul&gt;<br>   &lt;li v-for=&quot;num in numbers&quot;&gt;{{num}}&lt;/li&gt;<br>&lt;/ul&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>           numbers:[1,2,3,4,5,6]<br>        }<br>    },    <br>})</pre><h3>v-on :</h3><ul><li>The v-on directive can be used to create event listeners within the DOM to enable to do something when a particular event happens. You can also use <strong>@ </strong>to declare an event in Vue. There are some popular events :</li><li>click</li><li>submit</li><li>keyup etc</li></ul><p>and this event has some modifiers like :</p><ul><li>@click.stop=”” (the click event propagation will be stopped)</li><li>@submit.prevent=”” (the submit event will no longer reload the page)</li><li>@click.capture=”” (Use capture mode when adding the event listener)</li><li>@click.self=”” (only trigger handler if event.target is the same element itself)</li></ul><p>To learn more about Vue event: <a href="https://vuejs.org/v2/guide/events.html#Key-Codes">https://vuejs.org/v2/guide/events.html#Key-Codes</a></p><pre>HTML :<br>&lt;h1&gt;{{user}}&lt;/h1&gt;<br>&lt;button v-on:click=&quot;user=&#39;Pulkit&#39;&quot;&gt;Change User&lt;/button&gt;</pre><pre>main.js :<br>new Vue({<br>    el:&quot;#app&quot;,<br>    data(){<br>        return{<br>            user:&quot;Rasel&quot;<br>        }<br>    },    <br>})</pre><p>Go to the Vue.js Directive page to learn more : <a href="https://v3.vuejs.org/api/directives.html">https://v3.vuejs.org/api/directives.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b98797aec521" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vue-expert/day-3-vue-directives-30-days-of-vue-b98797aec521">#Day 3 : Vue Directives || 30 Days of Vue</a> was originally published in <a href="https://medium.com/vue-expert">Vue Expert</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#Day 2 : The Vue Instance-Date || 30 days of Vue]]></title>
            <link>https://medium.com/vue-expert/day-2-the-vue-instance-date-30-days-of-vue-1d4cbf07d894?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d4cbf07d894</guid>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 18:25:34 GMT</pubDate>
            <atom:updated>2021-08-24T18:25:34.010Z</atom:updated>
            <content:encoded><![CDATA[<h3>#Day 2 : <strong>The Vue Instance-Date || 30 days of Vue</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*GIEiDCSeUOJiHHieqeIW_w.png" /></figure><p>Let’s reiterate what we’ve learned from the previous article, the Vue instance is the starting point of the Vue application, and it contains data property that allows you to bind data from our instance and on the template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*FalXxw3c7AkU4yQW3GhpZw.png" /></figure><p>In the last article, we bound the <strong>test </strong>property as a data property shown in the <strong>HTML </strong>templates.</p><p>Now let’s bound some different properties inside the data and show that data property value in our <strong>HTML </strong>templets with the help of double curly bracket {{}}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-n8NYjzXFhS5bKsoUIlkyA.png" /></figure><p>The data property of an instance is known to be reactive, which means if we modify or change the data value, Vue will recognize the change and re-render the template to show the updated value of the data.</p><h3>Methods and Event</h3><p>Now let’s see the real example of data reactivity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*Tuiissk-TxHUKsV1TCaGjw.png" /></figure><p>Here to change the data value, We will provide a button in the HTML templates that will be responsible for changing.</p><p>Now out button doesn’t do anything for the interactivity. We can attach a <strong>click listene</strong>r to the button to trigger the change of data property.</p><p>To facilitate this change, we can use instance’s methods property, and this method will be able to change data value directly.</p><p>So let’s see how we can do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZhxD_qqzIkjdK6vWkP1FJg.png" /></figure><p>In our example, we’ll create a <strong>changeUser() </strong>method that changes the value of user property. And for referencing the user property in the <strong>changeUser()</strong> method, we are using <strong>this </strong>keyword.</p><p>Let’s see the output and understand how it’s work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e0rocJ7BQSEoaoEqSrW7tw.png" /></figure><p>When we click the button, the <strong>changeUser()</strong> method is called, which is change the user value. When the user value changes, the templets are automatically re-rendered to show the change</p><p>Vue.js Doc <a href="https://vuejs.org/v2/guide/reactivity.html">https://vuejs.org/v2/guide/reactivity.html</a></p><p>Thanks 😍😍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d4cbf07d894" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vue-expert/day-2-the-vue-instance-date-30-days-of-vue-1d4cbf07d894">#Day 2 : The Vue Instance-Date || 30 days of Vue</a> was originally published in <a href="https://medium.com/vue-expert">Vue Expert</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#Day 1: Introduction of Vue || 30 Days of Vue]]></title>
            <link>https://medium.com/vue-expert/day-1-introduction-of-vue-30-days-of-vue-c0db269e12a2?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0db269e12a2</guid>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 18:24:19 GMT</pubDate>
            <atom:updated>2021-08-24T18:24:19.513Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*GIEiDCSeUOJiHHieqeIW_w.png" /></figure><h3>What is Vue.js?</h3><blockquote>Vue is an open-source progressive javascript framework that is approachable, versatile, and performant. Vue is made for building User Interface and it’s created by “Evan You”.</blockquote><h3>How do you use it?</h3><blockquote>This is the simple way to get started working with vue by placing a script tag in the HTML that loads the latest version of Vue from CDN. We can also reference a javascript file (named index.js/ main.js) which would be the file where our Vue code will lives.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6qKPj_rF3AdeQguNmxwNbg.png" /></figure><blockquote>After connecting the Vue CDN, now we can create a Vue application by declaring the Vue instance in the main.js.</blockquote><blockquote>And the Vue instance is created by declaring the “<strong>new </strong>Vue({})”<strong> </strong>constructor.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vP_KHD2daNJPqI9ScANEvg.png" /></figure><blockquote>In here we’ve just used the element option <strong>el, </strong>to dictate the HTML element with the “<strong>id”</strong> of “<strong>app”. </strong>Here I just mount the Vue application with #app</blockquote><blockquote>The Vue instance can also return the date that will be shown in our view.</blockquote><blockquote>And this data has to be dictated within a data option. let’s declare a <strong>test </strong>data property that giving a string value of <strong>Hello world!</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*Qid66TJylvw2CpcbMRYIdw.png" /></figure><blockquote>Now we are able to display the value of the test property on the HTML template. But to bind the data value as a text content we have to use double curly bracket {{test}}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6lpfJWFhUfSY0Uh1_CEoBA.png" /></figure><blockquote>Now let’s see the output…</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cnJWOkmVJRi9fv5QndU_5w.png" /></figure><blockquote>This is easy, isn’t it? In the same way, we can declare other data property that our need</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PcF0khySbZqutKheMKOO1g.png" /></figure><blockquote>Thank You 🥰🥰</blockquote><blockquote>Vue.js Official Doc <a href="https://vuejs.org/v2/guide/">https://vuejs.org/v2/guide/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0db269e12a2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vue-expert/day-1-introduction-of-vue-30-days-of-vue-c0db269e12a2">#Day 1: Introduction of Vue || 30 Days of Vue</a> was originally published in <a href="https://medium.com/vue-expert">Vue Expert</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Some Core Thing]]></title>
            <link>https://raselhossainy52.medium.com/javascript-some-core-thing-701a62495ec7?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/701a62495ec7</guid>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Sat, 08 May 2021 09:20:06 GMT</pubDate>
            <atom:updated>2021-05-08T09:20:06.448Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Truthy and Falsy values</strong></h3><p>In javascript, there have two types of boolean value one is Truthy value and the other is a falsy value. when you write if/else statement in any programming language, you expect two value in the if() 1. true 2.false</p><h3>Truthy values</h3><p>Here is some truth values example:</p><pre>if (true)<br>if ({})<br>if ([])<br>if (42)<br>if (&quot;0&quot;)<br>if (&quot;false&quot;)<br>if (new Date())<br>if (-42)<br>if (12n)<br>if (3.14)<br>if (-3.14)<br>if (Infinity)<br>if (-Infinity)</pre><h3>Falsy values</h3><p>Here is some falsy values example :</p><pre>if (false)<br>if (null)<br>if (undefined)<br>if (0)<br>if (-0)<br>if (0n)<br>if (NaN)<br>if (&quot;&quot;)</pre><h3><strong>Null Vs Undefined</strong></h3><p>When defining a variable but not assign a value to it, it automatically puts a placeholder which is called undefined.</p><p><strong>Null </strong>means an empty value. when you declare a variable but you do not want to assign a value to it also you want to use it without a return Undefined so you can use Null as a primary value of this variable</p><h3>Double Equals vs. Triple Equals</h3><p>In JavaScript, you can test equality in two different ways, one is == and the other is ===<br>==(double equals) just compare is two values equal or not.</p><p>===(triple equals) compare is two value are equal or not also check two value are same data types</p><h3><strong>Difference Between bind, call, and apply</strong></h3><p><strong>Call( )</strong>: The call() method invokes a function with a given ‘this’ value and arguments provided one by one.</p><p><strong>Apply( )</strong>: Invokes the function and allows you to pass in arguments as an array.</p><p><strong>Bind()</strong>: returns a new function, allowing you to pass in an array and any number of arguments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=701a62495ec7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All About React.js]]></title>
            <link>https://raselhossainy52.medium.com/all-about-react-js-f60ecafffb18?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/f60ecafffb18</guid>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Sat, 08 May 2021 07:27:45 GMT</pubDate>
            <atom:updated>2021-05-08T07:27:45.321Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*1kgHecIu1rfH74bs_h7XBA.jpeg" /></figure><h3><strong>What and Why is React.js</strong></h3><p>React is a javascript library, not a “framework”. It’s used for building a user interface.</p><h3><strong>Framework VS Library</strong></h3><p>Frameworks serve a great purpose, especially for young teams and startups. Frameworks are built with some libraries. When you working with a framework, many smart designs are already made for you, which is give you a clear path to focus on writing good-level application logic. But Framework comes with some disadvantages. Frameworks are not flexible. A framework usually wants you to code everything a certain way. If you try to deviate from that way, the framework usually ends up fighting you about it.</p><h3>Your First React Code</h3><p>in this session, a simple HTML element is rendered to the display using 2 methods:</p><ol><li><strong>Using the web DOM API</strong></li></ol><p>document.getElementById(‘mountNode’).innerHTML = `<br> &lt;div&gt;<br> Hello HTML<br> &lt;/div&gt;<br>`;</p><p><strong>2.Using React API</strong></p><p>ReactDOM.render(<br> React.createElement(<br> ‘div’,<br> null,<br> ‘Hello React’,<br> ),<br> document.getElementById(‘mountNode2’),<br>);</p><p>The ReactDOM.render method and React.createElement the method is the core API method in a React application.</p><h3><strong>ReactDOM.render</strong></h3><p>This is basically the entry point for a React application into the browser’s DOM. It has 2 arguments :</p><ol><li>The first argument is what to render to the browser.</li><li>The second argument is where to render the React element in the browser</li></ol><h3><strong>React.createElement</strong></h3><p>The React.createElement function has many arguments:</p><ol><li>The first argument is the HTML tag for the DOM element to represent</li><li>The second argument is for any attributes</li><li>The third argument is the content of the DOM element</li></ol><h3>What is JSX</h3><ol><li>JSX Stands for Javascript XML</li></ol><p>2. JSX allows us to write HTML code in React</p><p>3. JSX makes it easier to write and add HTML in React</p><p>JSX converts HTML tags into react elements.</p><p>Example</p><pre>const myelement = &lt;h1&gt;I Love JSX!&lt;/h1&gt;;<br><br>ReactDOM.render(myelement, document.getElementById(&#39;root&#39;));</pre><h3><strong>React Default Props</strong></h3><p>We can declare default props like this:</p><pre>class CustomButton extends React.Component {<br>  // ...<br>}<br><br>CustomButton.defaultProps = {<br>  color: &#39;blue&#39;<br>};</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f60ecafffb18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “try…catch” :]]></title>
            <link>https://raselhossainy52.medium.com/the-try-catch-51d3654fc92d?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/51d3654fc92d</guid>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Fri, 07 May 2021 11:13:00 GMT</pubDate>
            <atom:updated>2021-05-07T11:13:00.254Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*23n0IoTQkFdKjc8WRQ44oQ.png" /></figure><h3><strong>The “try…catch” :</strong></h3><p>There has to the two main block of try…catch one is try and second is the catch.</p><p>The syntax of try and catch :</p><p>try {</p><p>//code…..</p><p>}catch(err){</p><p>//error handling</p><p>}</p><p>The try …catch works like this:</p><ol><li>First, the code executed the try block</li><li>if there were no errors, then the catch(err) is ignored.</li><li>if an error occurs, then the try execution is stopped, then the control flows got to the catch(err) block.</li></ol><h3><strong>Clean Code :</strong></h3><p>Our code must be as clean and easy to read as possible.</p><p>Here are the some commend to make a code clean:</p><ol><li>A space between parameters</li></ol><p>function test(x, n) {}</p><p>2. No space between function name and parentheses</p><p>function test()</p><p>3.Curly brace { on the same line, after space</p><p>function test() {</p><p>4.Space around operators</p><p>5 + 10</p><p>5.Space between arguments</p><p>test(“x” , “y”);</p><p>6. else without a line break</p><p>if (…) {</p><p>} else {</p><p>}</p><h3><strong>Comments :</strong></h3><p>A comment is just for use to describe how and why the code works. Use comment in a code is a good practice but novice programmers often use them wrongly. In javascript, there have two types of comment one is Single line comment and the other is a Multiline comment.</p><p><strong>single-line comment:</strong></p><p>// this is the single-line comment</p><p><strong>Multiline comment :</strong></p><p>/* this is the multiline comment */</p><h3><strong>Var Declarations and Hoisting :</strong></h3><p>variables declared using “var” are created before any code is executed in a process known as hoisting. Their initial value is undefined</p><h3><strong>Block-Level Declarations :</strong></h3><p>Block-level declarations are the ones that declare variables that are far outside of the given block scope. Block scopes, also known as lexical scopes, are created either inside of a function or inside of a block. Block scoping is how many C-based languages work, and the introduction of block-level declarations in ECMAScript 6 is intended to bring that same flexibility (and uniformity) to JavaScript.</p><h3><strong>Functions with Default Parameter Values :</strong></h3><p>In JavaScript, function parameters default to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a>. However, it&#39;s often useful to set a different default value. This is where default parameters can help.</p><pre>function append(value, array = []) {<br>  array.push(value)<br>  return array<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51d3654fc92d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Core Concept of Javascript]]></title>
            <link>https://raselhossainy52.medium.com/core-concept-of-javascript-c145e506928?source=rss-ddc999966870------2</link>
            <guid isPermaLink="false">https://medium.com/p/c145e506928</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Rasel Hossain]]></dc:creator>
            <pubDate>Wed, 05 May 2021 15:02:23 GMT</pubDate>
            <atom:updated>2021-05-05T15:02:23.653Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is JavaScript :</h3><p>javascript is a scripting or programming language that allows you to implement complex features on web pages. With the help of javascript, you can be displaying timely content updates, control multimedia, animate images, manipulate HTML, CSS, and more things you can do.</p><h3><strong>String in Javascript:</strong></h3><p>Javascript String stores a series of characters like “Rasel Official”.</p><p>If you store any characters in “, ‘’, or `` that is called String.</p><p><strong>Here is some Javascript String Properties :</strong></p><ol><li>charAt() =&gt; return the character at the specified index position</li><li>charCodeAt() =&gt; returns the Unicode of the character at specified index</li><li>concat() =&gt; join tow or more string ,and returns a new joined strings</li><li>endsWith() =&gt; checks whether a string ends with a specified string</li><li>includes() checks whether a string contains the specified string</li><li>indexOf() =&gt; returns the position of the first found occurrence of a specified value in a string</li></ol><h3><strong>Number in JavaScript :</strong></h3><p>in Javascript Number is a Primitive data type:<br>here some numbers like 1468(integer),3.45(Float) but in javascript integer and float all these numbers are just numbers.</p><p>we can declare a number with the help of the JavaScript Number constructor Like “Number(45)”.</p><p>We can also convert a string to a number with this Number constructor.</p><p>Here are Some Number Properties :</p><ol><li>Number.parseFloat(5634) =&gt; if you want to convert an integer number to a floating number then you can use this number property.</li><li>Number.parseInt(45.56456) =&gt; if you want to convert a floating number to an integer number then you can use the method easily.</li><li>if you want to see how many values javascript can store =&gt; console.log(Number.MAX_VALUE)</li><li>At the same time, you can check what is the lowest number javascript can store.</li><li>if you want to add a number with a string it returns NaN (Not a Number)</li></ol><h3><strong>Math in JavaScript :</strong></h3><p>Javascript math object allows you to perform mathematical tasks on numbers. The syntax for any Math property is Math. property.</p><p><strong>Here is some Math Property :</strong></p><ol><li>Math.E =&gt; returns Euler’s number</li><li>Math.PI =&gt; returns PI value</li><li>Math.abs(-64564) =&gt;returns positive value</li><li>Math.floor(55.54) =&gt; returns 55</li><li>Math.ceil(55.45) =&gt; returns 56</li><li>Math.round(5.64) =&gt; returns 6</li><li>Math.max(5,6,8,0,3) =&gt; returns maximum value</li><li>Math.min(5,6,8,0,3) =&gt; retuns minmum value</li><li>Math.sqrt(36) =&gt; return 6</li><li>Math.pow(5,2) =&gt; return the power of 5</li></ol><h3><strong>Javascript Array :</strong></h3><p>Javascript arrays are used to store multiple values in a single variable;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zmDZPFvLFIiT3PfNxgkS7g.jpeg" /></figure><p>If You have a list of items and you want to store all this value in a single variable then you can use an array.</p><p>In Javascript Array looks like this :</p><p><strong>const array =[52,6,4,apple,orange]</strong></p><p>in this array, all items have a unique number that’s call index.</p><p>you can access array value like this.</p><p>array[0]</p><p>array[1]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zmDZPFvLFIiT3PfNxgkS7g.jpeg" /></figure><p>array[2]</p><p><strong>Here is some Javascript Array Method :</strong></p><ol><li>join() =&gt; Jon method converting an array to string it behaves just like toString().</li><li>pop() =&gt; pop method removes the last element from an array</li><li>push() =&gt; push method adds a new element to an array at the end.</li><li>shift() =&gt; shift method remove the first element of an array</li><li>unShift() =&gt; unshift() method add an element at hthe begining.</li><li>length =&gt; length property provide how many array element have an array</li><li>delete =&gt; Javascript arrays are objected, an element can be deleted by using the javascript delete operator</li><li>splice() =&gt; splice method can be used to add,deleteitem to an array</li><li>concat() =&gt; concat method create a new array by marging tow arrays</li><li>slice() =&gt; slice method slice out a piece of an array into a new array</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c145e506928" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>