<?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 Yogini Bende on Medium]]></title>
        <description><![CDATA[Stories by Yogini Bende on Medium]]></description>
        <link>https://medium.com/@hey-yogini?source=rss-f6d2cef4e0fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qRux-ZAff22iSg5-5AULLQ.jpeg</url>
            <title>Stories by Yogini Bende on Medium</title>
            <link>https://medium.com/@hey-yogini?source=rss-f6d2cef4e0fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:15:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hey-yogini/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[React Router: A simple tutorial on nested routes.]]></title>
            <link>https://hey-yogini.medium.com/react-router-a-simple-tutorial-on-nested-routes-5e074df8c35f?source=rss-f6d2cef4e0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e074df8c35f</guid>
            <category><![CDATA[javascript-frameworks]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-router]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Yogini Bende]]></dc:creator>
            <pubDate>Tue, 16 Feb 2021 14:21:51 GMT</pubDate>
            <atom:updated>2021-02-16T14:30:14.495Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S1_u8Pnhb_XnjTFLrsj1YQ.jpeg" /></figure><p>Hello folks,</p><p>React Router Dom becomes one of the mandatory libraries to understand when you are working with ReactJS. Before a while, I came across this very common use-case of React Routing, where there are nested routes at many levels. Initially I was pretty confused, as React Router’s simple nested routing pattern couldn’t work for me. I had to implement routing which was nested upto 3 levels.</p><p>This becomes a very common use case when you are working with React App, so I thought of sharing my routing approach here. So, let’s dive in.</p><p>For this tutorial, I created a simple project with `create-react-app` and added `react-router-dom` to it using `npm`. As these are pretty basic steps, I am not including them into this article. If you want to skip this tutorial and directly check the code, you can check my <a href="https://github.com/ms-yogi/react-nested-routes">github repo</a>.</p><p>So, we are going to create a simple looking dashboard, which will have one common sidebar with some page link. One of these pages will have a separate navigation bar on top to go to some more pages directly. We will also have one login page, from which we will go inside this dashboard. Pretty straightforward, right? <br>*P.S. There will not be any login system or authorisation for any routes as that is out of scope for this tutorial.*</p><p>The routing will start by adding a `BrowserRouter` to the app. So inside `App.js`, wrap complete code into `BrowserRouter`. Now, let us create a very simple login page, to get started with the app.</p><pre>import { Link } from ‘react-router-dom’;<br>const Login = (props) =&gt; {<br> return (<br> &lt;&gt;<br> &lt;div className=’login’&gt;<br> &lt;p&gt;Login to the app&lt;/p&gt;<br> &lt;Link to=’/home’ className=’button’&gt;<br> Login<br> &lt;/Link&gt;<br> &lt;/div&gt;<br> &lt;/&gt;<br> );<br>};<br>export default Login;</pre><p>Here, we are just creating a button to create an effect of login. This button will have a link to the `/home` page, where the remaining app is present.</p><p>Now, to move forward, we will create and define other routes for our app. In this app, we will have one single registry for defining routes. I will call it `Routes.js`.</p><p>In react router, common way to declare a route is to define a component and a path for that route. So, we will create an array of objects, where each object will represent a single route. With some basic routes, our `Routes.js` will look something like this,</p><pre>import Home from ‘./Home’;<br>import Login from ‘./Login’;<br>const routes = [<br> {<br> path: ‘/login’,<br> component: Login,<br> },<br> {<br> path: ‘/home’,<br> component: Home,<br> },<br>];</pre><pre>export default routes;</pre><p>Here, our Home component is the root component inside our app. Now, we need to add nesting from Home component. Inside home, we will have a common sidebar and one main section where we will render all the pages from that sidebar.</p><p>Hence, our next requirement will be to add those pages as a nested route from the home component. To create these nested routes, we will create one similar array of routes, as we have created above, but inside Home component. React Router Dom have added a property called routes, to every Route component and that property will contain list of all the nested routes. Let’s update our route component with some pages inside Home.</p><p>So, our route will look something like this:</p><pre>import Home from ‘./Home’;<br>import Login from ‘./Login’;<br>import Page1 from ‘./pages/Page1’;<br>import Page2 from ‘./pages/Page2’;<br>const routes = [<br> {<br>   path: ‘/login’,<br>   component: Login,<br> },<br> {<br>   path: ‘/home’,<br>   component: Home,<br>   // added nested routes<br>   routes: [ <br>     {<br>       // Also note how we added /home before the <br>       // actual page name just to create a complete path<br>       path: ‘/home/page1’,<br>       component: Page1,<br>     },<br>     {<br>        path: ‘/home/page2’,<br>        component: Page2,<br>     },<br>   ],<br> },<br>];</pre><pre>export default routes;</pre><p>Till now, we have created some nested routes but those are yet to be configured inside our app. So, let’s add these to `App.js` inside `BrowserRouter`.</p><pre>import { BrowserRouter, Redirect, Switch } from ‘react-router-dom’;<br>import routes from ‘./Routes’;<br>import RouteWithSubRoutes from ‘./utils/RouteWithSubRoutes’;<br>function App() {<br> return (<br>   &lt;BrowserRouter&gt;<br>     &lt;Switch&gt;<br>       &lt;Redirect exact from=’/’ to=’/login’ /&gt;<br>       {routes.map((route, i) =&gt; (<br>          &lt;RouteWithSubRoutes key={i} {…route} /&gt;<br>       ))}<br>     &lt;/Switch&gt;<br>   &lt;/BrowserRouter&gt;<br> );<br>}</pre><pre>export default App;</pre><p>Code for `App.js` is quite simple. We have added one `BrowserRouter` and one ‘Switch’. We are redirecting our app from `/` to `/login` and then load all routing.</p><p>The map function is just iterating over the routes array, but now you can see one interesting component `RouteWithSubRoutes`. Let us understand what we are doing inside it.</p><pre>import { Route } from ‘react-router-dom’;<br>const RouteWithSubRoutes = (route) =&gt; {<br> return (<br>   &lt;Route<br>     path={route.path}<br>     render={(props) =&gt; (<br>       &lt;route.component {…props} routes={route.routes} /&gt;.<br>     )}<br>   /&gt;<br> );<br>};</pre><pre>export default RouteWithSubRoutes;</pre><p>Here, we are just returning the same component but important point to note here is, we are passing all the subroutes, to that component. Hence, the parent route will always be aware of all of its subroutes.</p><p>Alright, our routes are sorted, app component is sorted. Now, we will need to see how home component will manage all those subroutes which we have just passed to it.</p><p>Here is our Home component:</p><pre>import { Switch, Link } from ‘react-router-dom’;<br>import RouteWithSubRoutes from ‘./utils/RouteWithSubRoutes’;<br>// Notice how we are passing routes here <br>const Home = ({ routes }) =&gt; {<br> const menu = [<br>   {<br>     path: ‘/home/page1’, // the url<br>     name: ‘Page1’, // name that appear in Sidebar<br>   },<br>   {<br>     path: ‘/home/page2’,<br>     name: ‘Page2’,<br>   },<br> ];<br> <br> return (<br>     &lt;div className=’home’&gt;<br>     {/* This can be treated as a sidebar component */}<br>       &lt;div className=’sidebar’&gt;<br>         &lt;h2&gt;React Nested Routes&lt;/h2&gt;<br>         &lt;ul&gt;<br>           {menu.map((menuItem) =&gt; (<br>              &lt;li key={menuItem.name}&gt;<br>                &lt;Link to={menuItem.path}&gt;{menuItem.name}&lt;/Link&gt;<br>              &lt;/li&gt;<br>           ))}<br>         &lt;/ul&gt;<br>       &lt;/div&gt;</pre><pre>     &lt;Switch&gt;<br>       {routes.map((route, i) =&gt; (<br>          &lt;RouteWithSubRoutes key={i} {…route} /&gt;<br>       ))}<br>     &lt;/Switch&gt;<br>     &lt;/div&gt;<br>  );<br>};</pre><pre>export default Home;</pre><p>Home component is similar to any usual react component. We have created an array here just to show the sidebar and we have added links to all the pages inside that sidebar. One `Switch` is there to render the component which user selects on clicking the sidebar and again, it is using the same `RouteWithSubRoutes` component to pass on further subroutes(If any).</p><p>One thing which is very important to notice here is routes passed down to home component like props. This way the Home will always be aware of its subcomponents and routing will never go wrong!</p><p>You can keep nesting in more levels as required in your app with the same approach. In the <a href="https://github.com/ms-yogi/react-nested-routes">github repo</a> I have also added a Navbar to one page. You can check that out.</p><p>There is also one similar example in the official documentation of react router <a href="https://reactrouter.com/web/example/route-config">here</a>.</p><p>That’s all about the nested routing for React! If you follow some different approach for this, do let me know that in comments.</p><p>This story is originally published on <a href="https://dev.to/ms_yogii/react-router-a-simple-tutorial-on-nested-routes-1237">DEV</a>.</p><p>And your feedback on article will always be welcomed!! <br>Keep learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e074df8c35f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JS Basics: All about ‘This’ keyword.]]></title>
            <link>https://hey-yogini.medium.com/js-basics-all-about-this-keyword-c0eeed83e80b?source=rss-f6d2cef4e0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0eeed83e80b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-basics]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[es6-in-depth]]></category>
            <dc:creator><![CDATA[Yogini Bende]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 09:01:58 GMT</pubDate>
            <atom:updated>2021-02-09T09:01:58.179Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi folks,</p><p>This keyword has always been a topic of confusion for most of the developers and I can say I was always one of them! After doing a good reading on this part, I thought of sharing my understanding with others as well.</p><p>The basic function of `this` keyword is to store the current execution context of the program. In simple words, it refers to the object that is executing the current function. As it stores the current execution context, it starts getting confusing because its value will vary based on execution of the function (function’s execution context) and on strict or non-strict mode.</p><p>In this article I have divided `this` keyword into different use cases. Let’s go through it one by one and understand `this` in a better way possible.</p><p>- If this is called in a global scope, it will always refer to the window object in both strict and non-strict mode. <br>For e.g.</p><p>```<br>let x;<br>function printX() {<br> //some code for function<br>}<br>console.log(this); <br>// As this is called in global scope, it will always point to the window object.<br>```</p><p>- If `this` is called in a function which is a part of object, it will refer to that object. This will remain same for strict mode.</p><p>```<br>let obj = {<br> x: 10,<br> y: 20,<br> add: function() {<br> console.log(this.x + this.y)<br> // This here will point to the obj object <br> here, as function add is a method of object <br> obj.<br> }<br>}<br>obj.add() <br>// It will print 30, as x and y are taken from the obj object.<br>```</p><p>- If `this` is called from a regular function, it will always refer to a global object i.e window object. But in case of strict mode, if the value of this is not defined, it will return `undefined`.</p><p>You can learn more about the javascript `strict` mode from my [previous article](<a href="https://dev.to/ms_yogii/js-basics-understanding-strict-mode-370e">https://dev.to/ms_yogii/js-basics-understanding-strict-mode-370e</a>)</p><p>```<br>function y() {<br> console.log(this)<br>}<br>y(); <br>// As program is not running in strict mode and this is a regular function, this will refer to the window object<br>```</p><p>- If `this` is called from a constructor function, it will refer to its outer function for normal function and to window object for arrow functions. It will not be the case in strict mode, it will be `undefined`, as `this` keyword will work same in functional as well as class component.</p><p>```<br>function y(title) {<br> this.title = title;<br> console.log(‘y:’, this);<br> function x() {<br> console.log(‘x’, this); <br> // This will refer to window object as it is <br> called from regular function and this is <br> not set<br> }<br> let z = () =&gt; {<br> console.log(‘z:’, this);<br> // This will refer to this object inside y as <br> at the time of creation of arrow function z, <br> this was already set to function y.<br> };<br> x();<br> z(); <br>}<br>// Here, this will return {title: ok}, as this is defined. If it is not defined it will return window object <br>let p = new y(‘ok’); <br>// Here, when a new operator is used, it will create a blank object {} as a scope and this keyword will start referring to that new blank object.<br> <br>```</p><p>- If you are using call, apply or bind methods to attach the scope of `this` keyword, then the object on which the methods are attached or bound, this will refer to them.</p><p>```<br>let obj1 = {<br> x: 10,<br> printX: function() {<br> console.log(this.x)<br>}<br> }<br> <br>let obj2 = {<br> x: 20<br>}<br> <br>obj1.printX.call(obj2)<br>// here, due to call method, this inside the printX() method will refer to the obj2 object.<br>```</p><p>- If you are using this inside arrow function, it will refer its outer scope at the time of arrow function creation</p><p>```<br>this.x = 10;<br>let y = () =&gt; {<br> console.log(this) <br>// this will refer to {x: 10} as it was the outer scope at the time of creation of this arrow function<br>};<br>y();<br>```</p><p>That’s all about `this` keyword. There is one more [article](<a href="https://codeburst.io/the-simple-rules-to-this-in-javascript-35d97f31bde3">https://codeburst.io/the-simple-rules-to-this-in-javascript-35d97f31bde3</a>) on this topic which has the cleanest ever explanation about `this`, do check that out.</p><p>I have tried covering all the possible use cases for this keyword. If you encounter any further use-cases do share them in comments. I would love your comments/feedback about the article as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0eeed83e80b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JS Basics: Understanding ‘strict mode’.]]></title>
            <link>https://hey-yogini.medium.com/js-basics-understanding-strict-mode-7232ec0d2174?source=rss-f6d2cef4e0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7232ec0d2174</guid>
            <category><![CDATA[es6-in-depth]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript-basics]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Yogini Bende]]></dc:creator>
            <pubDate>Tue, 02 Feb 2021 11:07:32 GMT</pubDate>
            <atom:updated>2021-02-02T11:07:32.379Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi folks,</p><p>Many of us have seen use strict at the start of javascript files. In this article, we will be covering javascript strict mode and non-strict mode also informally called <em>sloppy mode</em>.</p><p>JavaScript’s strict mode, introduced in ECMAScript 5, is a way to opt into a restricted variant of JavaScript. As per <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode">MDN documentation</a>, using strict mode will make many changes in the general javascript semantics -</p><ol><li>It eliminates some JavaScript silent errors by changing them to throw errors.</li><li>Fixes mistakes that make it difficult for JavaScript engines to perform optimisations: strict mode code can sometimes be made to run faster than identical code that’s not strict mode.</li><li>Prohibits some syntax likely to be defined in future versions of ECMAScript.</li></ol><p>Strict mode in javascript will tighten the rules for some behaviour. Strict mode changes otherwise accepted <em>bad syntax</em> into real errors. It will always keep your code secure. To use strict mode, you can make use of the ‘use strict’ directive.</p><h3>Using strict mode -</h3><p>You can either apply strict mode to the entire JS script or to the particular function. You cannot use strict mode to any block enclosed in {} braces. To apply strict mode to entire JS file, ‘use strict’ directive is called at the top of the file.</p><pre>‘Use strict’;<br>var abc;<br>function print() { <br>// ... remaining file<br>// ...</pre><p>If you add the ‘use strict’ directive at the start of the function, then the function will run in the strict mode.</p><pre>function helloWorld() {<br>    ‘use strict’;<br>    console.log(“Hello world! I am a strict mode function”);<br>}</pre><p>For javascript modules, the strict mode is enabled by default.</p><pre>function Jsmodule() {<br>    // because this is a module, its strict by default<br>}<br>export default Jsmodule;</pre><h3>Errors in strict mode -</h3><p>Strict mode makes it impossible to accidentally create global variables.</p><pre>function helloWorld() {<br>    ‘use strict’;<br>    x = 100;<br>    console.log(“Hello world! I am a strict mode function and x = ”, x);<br>}</pre><p>The above function will throw reference error considering the variable is not declared and it assumes you are trying to refer to some other variable. In non-strict mode, this would have led to a new variable declaration without giving an error.</p><p>In strict mode, deleting a variable is not allowed opposite to non-strict mode. Also, in strict mode we cannot assign value to non writable or getter property of an object. For non-strict mode javascript, this will end up just by creating a warning, but strict mode does not accept that.</p><p>In non-strict mode, generally you can create functions who have parameters with the same name. But strict mode throws a syntax error for that, as it requires every parameter to have a different name.</p><p>In browsers it is not possible to reference the window object through this keyword inside a strict mode. The this keyword in functions behaves differently in strict mode. this keyword always refers to the object that called the function. If the object is not specified, functions in strict mode will return undefined and functions in normal mode will return the global object (window).</p><p>Strict mode also makes impossible to easily access the most recently called function. These features of strict mode have many security advantages.</p><p>Modern JavaScript supports <strong>classes</strong> and <strong>modules</strong> — advanced language structures, that enable use strict automatically. So we don’t need to add the use strict directive, if we use them.</p><p>Because strict mode has many security advantages and it can eliminate the errors at a very early level, many people prefer to work in a strict mode.</p><p>Do share your comments/feedback about the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7232ec0d2174" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JS Basics: Difference between “null” and “undefined”]]></title>
            <link>https://hey-yogini.medium.com/js-basics-difference-between-null-and-undefined-3adec50d0ac?source=rss-f6d2cef4e0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3adec50d0ac</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript-basics]]></category>
            <dc:creator><![CDATA[Yogini Bende]]></dc:creator>
            <pubDate>Tue, 26 Jan 2021 10:26:13 GMT</pubDate>
            <atom:updated>2021-01-26T10:26:13.491Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Folks,</p><p>If you are working in javascript, you must be knowing these two keywords, null and undefined. Although we understand both of them, it becomes difficult to answer this particular question. So in today’s post let’s understand the difference between null and undefined.</p><p>Null and undefined are both <strong>falsy values</strong> and they are one of the javascript primitives (‘string’,’number’,’null’,’undefined’,’boolean’,’symbol’, ‘bigint’). Now let’s understand their difference.</p><p>The keyword undefined, as its verbal meaning says, is not defined. For example, If you are declaring a variable a and you are not passing any value to it. This means its value is not defined and so the variable a will get value undefined. Whenever you call a function or a variable and javascript do not know its value it will always return undefined. Try to do this, Declare a variable <em>num</em> and don&#39;t pass any value to it. Now let&#39;s print the variable num&#39;s value console.log(num) in your browser console and you will see undefined getting printed. This happened because your browser did not know the value of num as we had not defined it before! Also, as it is one of the javascript primitives, the type of undefined is also undefined!</p><p>We already have understood that, if something is not defined javascript gives it value is undefined. But then what about null? So null is something whose value you want to be nothing. Let me explain, suppose you have defined a variable a and you want its value to be nothing initially, So, instead of not giving it any value and making it undefined, you pass it Null meaning no value. Also, the type of null is an object. This is why according to <a href="https://developer.mozilla.org/en-US/docs/Glossary/Primitive">MDN documentation</a>, javascript has 6 primitives and there also is null, which is seemingly primitive, but indeed is a special case for every Object</p><p>So though null and undefined are almost the same, they have these differences in their types. While doing equality comparison in both, as both are falsy values == will give you a result true, but as both have different types, === will give you the result as false.</p><p>That’s all about Null and undefined.</p><p>Though this is a very basic topic, it becomes a tricky question for an interview! So share your comments/feedback about the article and also any of such tricky interview questions from your javascript interviews.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3adec50d0ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Math object: List of simple methods to make coding easier!]]></title>
            <link>https://hey-yogini.medium.com/javascript-math-object-list-of-simple-methods-to-make-coding-easier-8957c39bbc83?source=rss-f6d2cef4e0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8957c39bbc83</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[Yogini Bende]]></dc:creator>
            <pubDate>Wed, 26 Dec 2018 18:20:13 GMT</pubDate>
            <atom:updated>2018-12-26T18:20:13.631Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello folks! In this article, we will be exploring some methods from javascript <strong>Math</strong> object, which you should keep handy for your ease of programming!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ynFhUvoFkGug_RMZoKCWg.jpeg" /><figcaption>Image from unsplash.com</figcaption></figure><p>While writing code for some app or writing a small program, we come across situations where doing mathematical operations is necessary. In that case, if we don’t know about some awesome mathematical methods in javascript, we end up making the code larger and more complex!</p><p>But thanks to the <strong>Javascript Math object </strong>which have made this task so much easier for us. Though this object has many more useful methods, we will be walking through some of them which are most commonly used in our daily programming.</p><p><strong>But wait, is Math an object?</strong></p><p>The answer is Yes! <strong>Math </strong>is an object in javascript that has different properties and methods for mathematical operations. We use its methods to perform some operations on variables. Javascript defines some properties for the <strong>Math </strong>object such as <strong>Math.PI </strong>which has a fixed value and it is used as a <strong>constant</strong>. There are many more such properties, but we will not be going into that now.</p><p>So, this was the introduction for Math object. Now, let&#39;s dive in to understand its some of the most useful properties.</p><p><strong>Math.ceil(x)</strong><br>This will return the integer <strong>greater</strong> than or equal to a number. (Remember it as, a ceiling is always on top, so <strong>greater number</strong>) for e.g</p><pre>Math.ceil(14.5689)       //15<br>Math.ceil(14.1245)       //15</pre><p><strong>Math.floor(x)</strong><br>This will return the integer <strong>smaller</strong> than or equal to a number. (Remember it as, a floor is always at bottom, so <strong>smaller number</strong>) for e.g</p><pre>Math.floor(14.5689)       //14<br>Math.floor(14.1245)       //14</pre><p><strong>Math.max(x,y,…) or Math.max(…array)<br></strong>This function will return the <strong>largest value </strong>amongst all the values passed to it. You can use it more efficiently with an array. If you have an array of numbers and you want to find the <strong>largest element in an array</strong>, you can use this method with a <strong>spread operator</strong>. For e.g</p><pre>Math.max(5,10,15,20,88,15,164,12,35)        //164</pre><pre>var myArray = [5,10,15,20,88,15,164,12,35]<br>Math.max(...myArray)                        //164</pre><p><strong>Math.min(x,y,…) or Math.min(…array)<br></strong>This function works the same as above just in a reverse manner. It will return the <strong>smallest value </strong>amongst all the values passed to it. Just like Max, we can use it for an array. For e.g</p><pre>Math.min(5,10,15,20,88,15,164,12,35)        //5</pre><pre>var myArray = [5,10,15,20,88,15,164,12,35]<br>Math.min(...myArray)                        //5</pre><p><strong>Math.random()</strong><br>Well, this one is not new to us and almost all of us have used it. But still, I will explain it in short. This method returns a pseudo-random number between 0 and 1. This function doesn’t need any argument, it will return a number. For e.g.</p><pre>Math.random();                          //0.5670575851027215<br>Math.random();                          //0.8411440376300618</pre><p><strong>Math.round(x)</strong><br>This function is used to get an <strong>integer </strong>from a floating point value. It will return the value of a number rounded to the nearest integer. So, any number with a decimal point will get rounded to the original integer without a decimal point. For e.g.</p><pre>Math.round(11.5875411452)                 //11<br>Math.round(52.125741845)                  //52</pre><p><strong>Math.sqrt(x)</strong><br>The last in our list, but a very useful one. This will return the positive square root of a number passed to it as an argument. To find the number is a square or not, to find prime numbers, this function is mostly used. For e.g</p><pre>Math.sqrt(25)                           //5<br>Math.sqrt(90)                           //9.486832980505138</pre><p><strong>Math object</strong> has so many other properties and methods which are also very useful. But the above seven methods that we mentioned, are definitely top of them. Though this seems very easy stuff, its always a better option to keep such methods handy and in your memory to use it when required.</p><p>If you want to know all the other properties and methods of Math object, read the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math">MDN documentation</a>, they have everything described thoroughly.</p><p>So, this was all about <strong>Math object and its properties.</strong> There are many other predefined methods in javascript that are really useful for us in our daily programming. Do you remember any of them now? <strong>Let me know in the comments section which are other predefined methods in javascript that you feel are very useful.</strong></p><p>Till then, Keep coding! Keep hustling!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8957c39bbc83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding SEO (Part II) : SEO techniques that are useful while setting up a website (Technical…]]></title>
            <link>https://hey-yogini.medium.com/understanding-seo-series-part-ii-seo-techniques-that-are-useful-while-setting-up-a-website-ac8baef32c29?source=rss-f6d2cef4e0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac8baef32c29</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[seo-training]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[search-engine-optimizati]]></category>
            <category><![CDATA[seo-tips]]></category>
            <dc:creator><![CDATA[Yogini Bende]]></dc:creator>
            <pubDate>Wed, 29 Aug 2018 08:47:03 GMT</pubDate>
            <atom:updated>2018-08-29T08:59:17.290Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding SEO (Part II) : SEO techniques that are useful while setting up a website (Technical SEO)</h3><p>An article explaining what is technical SEO, which techniques it include and how to use them while setting up a new project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3tAxNGPEol7rW4IhhA2GAA.jpeg" /></figure><p>We are back with the second article of the SEO series. In the <a href="https://medium.com/blackslate/what-is-search-engine-optimization-seo-and-why-you-should-know-it-ada872869cc2">last article</a>, we got acquainted with the term Search Engine Optimization, we understood the logic behind it, how it works and why it is important for your website. In this article, we will take a step forward and I will introduce you with some basic but highly efficient SEO techniques that are useful while setting up a website. We will also come across, what are the best practices of SEO that will benefit your website traffic.</p><p>I have divided this article into 5 main sections, which are important with respect to SEO and which we can start working on as soon as we set up our website.</p><p><strong>P.S.</strong> Even if you already have a project started, you should go through this article and add your missing links at any point in time. I assure it will definitely benefit your web ranking.</p><p>So let’s get started.</p><h4><strong>Website’s Canonical URL: www or no www</strong></h4><p>While setting a website, the first thing you do is deciding on the website’s domain name. When you decide your domain name, one of the important point is deciding whether your domain name should have www or not in front of it.</p><p>I know what you are thinking, “Is it really the case?? Does it even matter? Every website has www by default. Isn’t it?”</p><p>You will surely get answers to this. Many of us don’t even notice the difference between these two. Look at the following links to understand this difference</p><p><a href="http://sample.com/">http://sample.com</a> | <a href="https://sample.com/">https://sample.com</a> | <a href="http://www.sample.com/">http://www.sample.com</a> | <a href="https://www.sample.com/">https://www.sample.com</a></p><p>Though this is the same website link, Google will understand it as four different websites with the duplicate content. This will lead to poor ranking and bad SEO.</p><p>To solve this problem, you need to decide which URL you are using, the one with www or without www. Both of them works similarly. So it can be completely your choice, but sticking to that choice for a lifetime of your website will be a good practice for optimizing its search engine performance.</p><p>Now, once you have selected your URL, this <em>preferred URL will be called as a canonical domain</em>. When we select our canonical domain, the next step is to tell the search engine about it. This can be done by adding a canonical tag to your source code. Canonical tag will be added into the head tag of every page of your website and it will look something like this -</p><pre>&lt;link rel=”canonical” href=”https://www.sample.com/&quot;/&gt;</pre><p>Where href attribute will contain your canonical domain. But make sure the link is pointing to exactly the same URL which you have decided.</p><p>It is highly <em>NOT</em> recommended to change this canonical domain once decided. But in some case, if you want to change it, make sure to use <em>server-side 301 redirects</em> and get your whole traffic to one point.</p><h4><strong>Robots.txt: Which pages of the site are available for search engines?</strong></h4><p>Next part of the process is adding a file called robots.txt. But what function this file performs, let’s look into that.</p><p>Search engine spiders try to access all the pages of your website which are publicly available. But, at times, you may want some pages to be available for a certain group of people only, maybe to your subscribers. In such cases, you need to tell spiders or crawlers not to read those pages and this task is done by robots.txt.</p><p><em>Robots.txt is a text file which we need to add to the root directory of your website. This file gives the instruction to the web crawlers about which pages they should add in their indexing and crawling.</em> It includes a list of all those pages which you want to keep private from crawlers.</p><p>While creating a robots.txt for your website, you need to be very careful. <em>A problem or misconfiguration in your robots.txt can cause critical SEO issues that can negatively impact your rankings and traffic.</em> Many times we don’t want to block any webpage from crawling, but it is a good practice to add default robots.txt to your website</p><p>You can only specify a name of directives in robots.txt. This file will not hide any content from crawlers. Also, this is a case-sensitive file. So, be very careful with writing names of your directives. For example, Sample.html will not block sample.html file from crawling.</p><p>Below is the example of robots.txt</p><pre>User-agent: *</pre><pre>Allow: /products</pre><pre>Allow: /careers</pre><pre>Allow: /services</pre><pre>Allow: /research</pre><pre>Disallow: /test</pre><pre>Disallow: /following</pre><pre>Disallow: /subscribers</pre><pre>Sitemap: https://sample.com/blog-sitemap.xml</pre><p>Let’s understand the meaning of all these. In this, <strong><em>user-agent</em></strong> specifies which crawlers should be considered. <strong><em>“User-agent: * ”</em></strong> tells that we have considered all search engine crawlers. <strong><em>Allow</em></strong> specifies which directives are allowed to access by the crawlers and <strong><em>disallow</em></strong> shows which directives to be skipped by crawlers. <strong><em>Sitemap</em></strong> directive is supported by all the search engines and it is used to specify the location of your XML Sitemap. You can generate your own sitemap or some websites will do it for you free.</p><p>We have understood what robots.txt is. But now the question is, <strong>how robots.txt is created?</strong></p><p>To create a robots.txt, just use any text editor like notepad and create a file with name robots and extension .txt. You can add default robots.txt as follows</p><pre>User-agent: *</pre><pre>Allow: /</pre><pre>Sitemap: <a href="https://example.com/sitemap.xml">https://example.com/sitemap.xml</a></pre><p>Add this file to the root directory(www or public_html folder) of your website and you are done with robots.txt.</p><h4><strong>SEO friendly URLs</strong></h4><p><em>URL i.e. Uniform Resource Locator of a web page is a link that we use to go on that page.</em> For every web page, this URL is a combination of two parts, the first part is a domain name of the website and second part is URL for that page. For example, from the following URL</p><pre><a href="http://www.sample.com/this-page-is-a-sample-page.html,">http://www.sample.com/this-page-is-a-sample-page.html</a> </pre><p>first part is website domain i.e. <a href="http://www.sample.com/">http://www.sample.com</a> and second part is page URL /this-page-is-a-sample-page.html.</p><p>When web crawlers search different pages, they use this URL as a reference to understand the content within that page. Hence, when we try to make a URL SEO friendly, we should include <em>maximum keywords</em> in a URL. Making use of keywords in the URL will help you in many ways. Its first benefit is, your users will be able to understand the context of your webpage. When you will add a link of this website to some anchor tags, these keywords will help in indexing your webpage.</p><p>When we create a URL, make sure that it is <em>neither too lengthy nor too short.</em> Search engine prefers shorter URL, so use the minimum words required. Also try to place the keywords at the beginning of your URL, so that web crawlers can crawl it easily and effectively.</p><p>While using keywords, many people tend to use one keyword more than once to get ranked by search engines. But trust me, this is the worst practice. Search engines will consider it as a <em>keyword stuffing</em> and you will not get ranked!</p><p>While creating any URL, <em>use hyphens instead of underscore or white spaces</em>. When you use underscore, Google will not differentiate keywords. For example, for a link this_is_a_url, Google will understand it as thisisaurl. White spaces get replaced by %20, So the URL “this is a URL”, Google will take it as this%20is%20a%20url. Both ways are neither user friendly nor search engine friendly. Hence to avoid this, use hyphens in URL than anything else.</p><p>Following these practices, you can easily create URLs which will benefit your search rankings.</p><h4>User Experience, Page Speed, and Mobile First Approach</h4><p>User experience, page speed and mobile first approach, though these are 3 different aspects of your website, they all are integrated with each other. Following their best practices will make a significant difference in SEO.</p><p>For understanding these three, we will start with the user experience (UX). <em>How long any user will stay on your website is decided by UX of your website. </em>With bad user experience, the bounce rate of your website becomes high and any search engine will never ignore that. To avoid high bouncing rate, your website should feel engaging to users. How your website handles errors, how it serves users, how easy it is to understand, these are all basics of having good web design. For e.g websites with creative 404 error pages.</p><p>Many such small factors creating good user experience will make your website get indexed better.</p><p>Page speed is one of the known ranking factors of the Google Ranking Algorithm. If your website is loading faster, or <em>if your website is taking less than 3–5 sec to load, you will get its advantage in ranking your website.</em></p><p><strong>But how page speed is improved??</strong></p><p>This question has vast focus, but keeping it short, let’s understand the factors affecting page speed. Good website structure, less inline styling, javascript files kept separately, optimized images, minified stylesheets and HTML markup, these are some simple factors which can improve your page speed dramatically.</p><p>Improving page speed is mostly a developer’s job. If the structure of the website is well maintained, it will take less time to load, improving the speed and improving the rankings.</p><p><em>We all know that more than 60% of web browsing is performed on mobile devices</em>. This means that your website has to be mobile friendly and offer a great experience to users on mobile. For better SEO ranking, test your website on different mobile devices and ensure that it loads fast and easy to use.</p><h4><strong>SSL Secure websites</strong></h4><p>Web security, a term which is highly trending these days and SSL secure website is something related to that only. <em>SSL stands for Secure Socket Layer. It is a security protocol that enforces encrypted communication between the web browser and the web server.</em></p><p>Well! If this sounds too complicated to you just consider <em>SSL as a security layer to your website</em>.</p><p>This means that any information that is transmitted between your website and a web server like usernames and passwords, credit card information and any other data submitted by users, is secure and encrypted.</p><p>To make your website secure with SSL, you need to purchase an SSL certificate and integrate that with your site. Websites that have an SSL certificate installed and configured can be accessed using <a href="https://www.sample.com/">https://www.sample.com</a> instead of the traditional non-secure way of <a href="http://www.sample.com./">http://www.sample.com.</a></p><p>From 2014, it was Google’s initiative to make the web more secure and introduced the slogan “<em>https everywhere</em>”. They started by making all google searches https and also announced that https websites would gain a very small ranking boost.</p><p>It is something, which everyone has to do sooner or later. But sooner you do it, easier will be your migration from HTTP to https. Hence, it will be always in a high recommendation to include SSL certification to your website.</p><p>That’s it for this article!</p><h4>Conclusion</h4><p>Techniques we studied in this article belongs more to technical SEO than on-page SEO. But these are very important when you are starting off a new project or when you are starting SEO for a project. This will create a base for your on-page SEO work.</p><p>In the next article, we will be learning on-page SEO techniques, what best practices you should follow while writing a markup of your website which helps to boost your search engine ranking, some do’s and don’ts for the on-page SEO and much more.</p><p>Till that time, stay tuned!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac8baef32c29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding SEO (Part I): What is Search Engine Optimization (SEO) and why you should know it?]]></title>
            <link>https://hey-yogini.medium.com/what-is-search-engine-optimization-seo-and-why-you-should-know-it-ada872869cc2?source=rss-f6d2cef4e0fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/ada872869cc2</guid>
            <category><![CDATA[search-engine-optimizati]]></category>
            <category><![CDATA[seo-tips]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[onpage-seo]]></category>
            <category><![CDATA[seo-training]]></category>
            <dc:creator><![CDATA[Yogini Bende]]></dc:creator>
            <pubDate>Fri, 24 Aug 2018 16:59:44 GMT</pubDate>
            <atom:updated>2018-08-29T08:48:17.772Z</atom:updated>
            <content:encoded><![CDATA[<p>A beginner’s guide introducing search engine optimization and its importance for your web presence</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BGT7ZmEBrjinq_Zmf6TSCA.jpeg" /><figcaption>Designed by Freepik</figcaption></figure><p>Search Engine Optimization, a term which came across me so many times in a couple of years when I started my journey of being a web developer. But I never paid much importance to know it deeply because of the thought that search engine optimization (SEO) is one of the marketing tools and I have nothing to do with it. But when I started knowing about it, I found that, it is a myth!</p><p>With SEO, you can easily make your websites search engine friendly, increasing the probability of many users visiting your website. This is why every front-end developer should know at least the basics of SEO techniques.</p><p>Wait! Every website tells the same story about SEO, but the important question is, how the probability of users visiting your website increases because of SEO? Why knowing SEO is important for a web developer? What exactly is done for SEO??</p><p>These are all those questions with which I started learning and in this series of exploring SEO, I will surely try to answer all of them.</p><p>So let’s start understanding search engine optimization.</p><p><strong>What is SEO?</strong></p><p><em>Search engine optimization is a process of optimizing your website so that, your website can be easily tracked by search engines and displayed in their top search results</em>. When you do SEO of your website, it becomes easier for search engines to index it and understand its content clearly. This makes your website rank higher by Google or other search engines and makes it appear at the top search results.</p><p>And who don’t know perks of getting appeared at top searches on Google? Better traffic and more users!</p><p>This is simple! If you want more traffic on your website, take the advantages of SEO. With good SEO practices you can not only get ranked on the first page of Google but also you can appear in one of the top five searches Google shows.</p><blockquote>Study shows, websites appearing on the first page of Google gets 73% clicks and those who appear in the top five search results get 67% of clicks.</blockquote><p><strong>But how Google decides which websites to show and in which order to show them?</strong></p><p><strong>Note: </strong>This can be a tricky thing to understand, but I am including this just for the knowledge of how Google or other search engines work. You can skip this part if it doesn’t make much sense to you.</p><p>Google and other search engines are constantly monitoring the web for new content and for changes to existing content. They have software and algorithms designed and dedicated for this purpose only.</p><p>Let’s understand this process.</p><p>Google initially creates indexes of all the websites that are available on the internet. When I say index, it means something similar to a catalog or a list, where information of websites is stored in the Google.</p><p>For every website, Google saves its URL, title, type of content, number of pages, images and many more such details. Programs which are used for gathering this information are called spiders or crawlers.</p><p>When you start searching for something, Google tries to understand what you are searching for, to display the content you need or similar to your need. For that, Google’s search algorithm gathers all the data from an index and starts ranking websites based on that data. Websites that match the content you searched for are ranked on the top and you see your search results.</p><p>Google’s search algorithm is made up of hundreds of rules and nobody knows what are these rules. <em>It is believed that Google considers more than 255 factors before ranking any website.</em> Though these rules are never openly shared by Google, there are some known factors such as page speed, SSL, mobile friendliness, page titles which make much difference in website ranking. Also, Google is constantly making changes to their ranking algorithm and every time they change it, ranking of websites is going to change.</p><p>So the major goal of doing SEO is to keep your website updated considering these factors, to appear in top searches.</p><p><strong>How to do SEO? What is done or added to the website for doing its search engine optimization??</strong></p><p>So, till now, we very well understood what SEO is and why it is important for your website. But the major question arises is how to implement it? How to do it on your website? What to add or remove for your site?? And this whole series of articles revolve around these questions.</p><p>There are two techniques of implementing SEO — <strong>On-page SEO and Off-page SEO</strong>. Let’s know them in brief.</p><p><strong>What is On-page SEO?</strong></p><p>On-page SEO is a technique used to make your website pages easy to understand by ranking algorithms. By adding certain information in a certain format, it becomes easy for Google to understand the context and content of your website. Because of this, proper indexing is done and you can see your website in top search results.</p><p>Some tags, titles, descriptions are added to the website during on-page SEO. This technique revolves around keywords and their good use in website content. Hence, if best practices are followed, on-page SEO is easy to implement and can be a major concern in making your website hit the top ranking.</p><p>On-page SEO brings organic traffic (traffic directly coming from Google search) to your website. This is why this SEO technique creates the base for your web traffic.</p><p><strong>What is Off-page SEO?</strong></p><p>This SEO technique mostly focuses on website promotion. It goes beyond website content and design. This part of the SEO process grabs the user attention from different parts of the web and increase the traffic of your website. This technique is important to increase the inorganic traffic( Indirect traffic, which is not coming from Google but from another medium like social media).</p><p>Though this is one of the important process of SEO, the best way to do it is after the on-page SEO.</p><p><strong>As a web-developer, why it is important for me to understand implementation of SEO?</strong></p><p>When we write markup for a website, there are some tags and some attributes which can make the on-page SEO much more efficient. But, because we don’t know their use with respect to SEO, we may not use them properly. When we will get to know the correct use of those tags in optimizing our search results, we will be able to make our website SEO friendly from the very beginning. That’s the reason, every front-end web developer should know these techniques.</p><p><strong>Conclusion</strong></p><p>In this article, we learned what is SEO, how Google performs its searches, why it is important to do SEO of your website and which are the techniques of doing SEO. This article series will focus only on on-page SEO techniques. In the next article, we will start exploring on-page SEO in more detail and will understand the ways of doing it.</p><p>Stay tuned!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ada872869cc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>