<?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 Harry Manchanda on Medium]]></title>
        <description><![CDATA[Stories by Harry Manchanda on Medium]]></description>
        <link>https://medium.com/@harrymanchanda?source=rss-5b320fd57b1e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l4Wub4djDtR2ks9yzk6exw.jpeg</url>
            <title>Stories by Harry Manchanda on Medium</title>
            <link>https://medium.com/@harrymanchanda?source=rss-5b320fd57b1e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:15:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harrymanchanda/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[Create your own Universally Unique Identifier (UUID)]]></title>
            <link>https://harrymanchanda.medium.com/create-your-own-universally-unique-identifier-uuid-523f15126949?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/523f15126949</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[hexadecimal]]></category>
            <category><![CDATA[uuid]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Sat, 09 Jan 2021 16:04:44 GMT</pubDate>
            <atom:updated>2021-01-10T14:13:56.634Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ki57nGFK279iN9dkmjuErQ.png" /><figcaption>Universally Unique Identifier (UUID)</figcaption></figure><p>You can create your own UUID with this below JavaScript function:</p><pre>function uuidv4() {</pre><pre>  const init = &quot;xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx&quot;;</pre><pre>  return init.replace(/[xy]/g, (c) =&gt; {</pre><pre>    const r = Math.random() * 16 | 0;</pre><pre>    const v = c == &#39;x&#39; ? r : (r &amp; 0x3 | 0x8);</pre><pre>    return v.toString(16);</pre><pre>  });</pre><pre>}</pre><p>Then, You would need to execute this function to generate a random UUID string. Every Time you execute there will be a new string.</p><pre>uuidv4(); // =&gt; 2fb0c438-a38b-4be0-9d53-df309a2ded95</pre><pre>uuidv4(); // =&gt; 6f48aa1a-fd44-454b-b796-bca06070d624</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=523f15126949" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 4 — Strings and ES6 Template Strings]]></title>
            <link>https://codeburst.io/part-4-strings-and-es6-template-strings-2872d7f7ea8e?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2872d7f7ea8e</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Sat, 30 Sep 2017 14:21:57 GMT</pubDate>
            <atom:updated>2017-09-30T14:21:57.857Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is Part 4 for the Series <strong>“Modern ES6+ Javascript for those who know only a little about that old Javascript.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*3zyOAYB2AfNIC_7O7F_ZNQ.png" /></figure><p>Cheers! This story is sponsored by and originally published at <a href="http://bit.ly/2ydIJwS">tech.io</a><br><a href="https://twitter.com/search?q=opensourceknowledge&amp;src=hash">#<strong>opensourceknowledge</strong></a> <a href="https://twitter.com/search?q=%23LearnForFree&amp;src=hash">#<strong>LearnForFree</strong></a></p><p>Welcome back, in the previous article we covered the <strong>Number</strong> Datatype within JavaScript. Now we will cover <strong>Strings</strong> and also ECMAScript 6, <strong>Template Strings</strong>!</p><h3>Strings</h3><p>In ECMAScript 5 and below, A string literal could only be wrapped in single quotes or double quotes. It can contain zero or more characters. The \(backslash) is the escape character. JavaScript was built at a time when Unicode was a 16-bit character set, so all characters in JavaScript are 16 bits wide. The escape sequences allow you to insert characters into strings that are not normally permitted, such as backslashes, quotes, and control characters.</p><pre>let a = &quot;I am a double quoted string&quot;;</pre><pre>let b = &#39;I am a single quoted string&#39;; // I like this more.<br></pre><pre>console.log(a); //=&gt; I am a double quoted string</pre><pre>console.log(b); //=&gt; I am a single quoted string</pre><p><strong>Concatenation</strong>: Strings are immutable. Once you add them, they can never be changed. That said, it is very easy to make a new string by concatenating other strings together with the + operator.</p><pre>let videos = &#39;Cat &#39; + &#39;Videos &#39; + &#39;on the web.&#39;;</pre><pre>console.log(videos); //=&gt; Cat Videos on the web.</pre><h3>Template Strings</h3><p>Also known as Template literals, ECMAScript 6’s template literals provide syntax for creating domain-specific languages (DSLs) for working with content in a safer way than the solutions available in ECMAScript 5 (and below).</p><p>In Technical terms, To allow developers to solve more complex problems, this scheme extends the ECMAScript syntax with syntactic sugar to allow libraries to provide DSLs that easily produce, query, and manipulate content from other languages that are immune or resistant to injection attacks such as XSS, SQL Injection, etc.</p><p>That said, in reality, template literals are simply ECMAScript 6’s answer to the following features that JavaScript lacked in ECMAScript 5 and in earlier versions:</p><ul><li><strong>Multiline strings</strong>: A formal concept of multiline strings</li><li><strong>Basic string formatting</strong>: The ability to substitute parts of the string for values contained in variables</li><li><strong>HTML escaping</strong>: The ability to transform a string so it is safe to insert into HTML</li></ul><p>The working community of ES6 decided that instead of adding more functionality to JavaScript’s already existing strings, they will provide template literals that would represent an entirely new approach to solving these problems. In simple terms, template literals just act like those regular strings but delimited by backticks (`) instead of double or single quotes. For example, consider the following:</p><pre>let message = `Hello world!`;<br></pre><pre>console.log(message);             //=&gt; Hello world!</pre><pre>console.log(typeof message);      //=&gt; string</pre><pre>console.log(message.length);      //=&gt; 12</pre><p>As you can see, the above code shows how the variable message contains a normal JavaScript string. The template literal syntax is used to create the string value, which is then assigned to the message variable. If you want to use a backtick within a string, you can just escape it with a backslash (\), as like below:</p><pre>let message2 = `\`Hello\` world!`;</pre><pre>console.log(message2);             // `Hello` world!</pre><pre>console.log(typeof message2);      // string</pre><pre>console.log(message2.length);      // 14</pre><p>Please remember that there’s no need to escape either double or single quote inside the template literals.</p><p><strong>Multiline Strings: </strong>Since the first version of the language, JavaScript community has been wanting a way to create multiline strings. But unfortunately, when you’re using double or single quotes, strings must be completely contained on a single line.</p><p>That said, JavaScript does have a workaround for creating multiline strings. You can create multiline strings by using a backslash (\) before a newline. Here’s an example:</p><pre>var message3 = &quot;Multiline \</pre><pre>string&quot;;<br></pre><pre>console.log(message3);</pre><p>As you see, this string has no newlines present when printed to the console because the backslash is treated as a continuation rather than a newline. If you want to show a newline within the output, you’d need to manually include it:</p><pre>var message4 = &quot;Multiline \n\</pre><pre>string&quot;;</pre><pre>console.log(message4);</pre><p>Other pre-ECMAScript 6 attempts to create multiline strings usually relied on arrays or string concatenation, such as the following:</p><pre>var message5 = [</pre><pre>&quot;Multiline &quot;,</pre><pre>&quot;string&quot;</pre><pre>].join(&quot;\n&quot;);</pre><pre>var message6 = &quot;Multiline \n&quot; +</pre><pre>&quot;string&quot;;</pre><pre>console.log(message5);</pre><pre>console.log(message6);</pre><p>In pre-ECMAScript 6 era, creating multiline strings for arrays found to be very useful for <strong>HTML escaping, </strong>and/or proper indentation of your HTML within JavaScript.</p><p>You would simply do something like:</p><pre>var oldTemplate = [</pre><pre>&#39;&lt;div class=&quot;callout&quot;&gt;&#39;,</pre><pre>&#39;&lt;p&gt;Foo Bar Baz are awesome&lt;/p&gt;&#39;,</pre><pre>&#39;&lt;/div&gt;&#39;</pre><pre>].join(&#39;&#39;);</pre><pre>console.log(oldTemplate);</pre><p>This may seem useful to you and make some sense but honestly, come ECMAScript 6, this sounds like you are just faking into the DOM. Clearly, not a great way! Here’s how you do them in ES6.</p><pre>var newTemplate = `</pre><pre>&lt;div class=&quot;callout&quot;&gt;</pre><pre>&lt;p&gt;Foo Bar Baz are awesome&lt;/p&gt;</pre><pre>&lt;/div&gt;</pre><pre>`;</pre><pre>console.log(newTemplate);</pre><p><strong>Making Substitutions: </strong>To this point, template literals may just look like to you as fancier versions of normal JavaScript strings. But, the real difference between the two is in template literal substitutions. It allows you to embed any valid JavaScript expression inside a template literal and output the result as part of the string. Here’s how:</p><pre>let friendsName = &quot;Nicolas Coden&quot;</pre><pre>let friendsMessage = `My friend ${friendsName} is a genius.`;</pre><pre>console.log(friendsMessage);</pre><pre>//=&gt; My friend Nicolas Coden is a genius.</pre><p>The substitution ${friendsName} accesses the local variable name and inserts it into the friendsMessage string. The message variable would then holds the result for the substitution.</p><blockquote><em>A template literal can access any variable accessible in the scope in which it is defined. Attempting to use an undeclared variable in a template literal throws an error in strict and non-strict modes.</em></blockquote><p>As all substitutions are just JavaScript expressions, you can substitute more than just simple variable names. You can easily embed calculations, function calls, and more.</p><h3>References</h3><p>This story has been proudly referenced by these books below:</p><ul><li><a href="https://www.amazon.com/Eloquent-JavaScript-Modern-Introduction-Programming/dp/1593272820">Eloquent JavaScript</a></li><li><a href="https://www.amazon.in/JavaScript-Good-Parts-Crockford/dp/8184045220">JavaScript the Good Parts</a></li><li><a href="https://www.amazon.com/Understanding-ECMAScript-Definitive-JavaScript-Developers/dp/1593277571">Understanding ECMAScript 6</a></li></ul><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also CodeBurst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2872d7f7ea8e" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/part-4-strings-and-es6-template-strings-2872d7f7ea8e">Part 4 — Strings and ES6 Template Strings</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 3 — Numbers in JavaScript]]></title>
            <link>https://codeburst.io/part-3-numbers-in-javascript-6e7d8ea516a4?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e7d8ea516a4</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Sat, 30 Sep 2017 14:21:22 GMT</pubDate>
            <atom:updated>2017-09-30T14:21:22.315Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is Part 3 for the Series <strong>“Modern ES6+ Javascript for those who know only a little about that old Javascript.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*Se4-6T3-LtED9zMfp2iOvw.png" /></figure><p>Cheers! This story is sponsored by and originally published at <a href="http://bit.ly/2hBtK8Y">tech.io</a><br><a href="https://twitter.com/search?q=opensourceknowledge&amp;src=hash">#<strong>opensourceknowledge</strong></a> <a href="https://twitter.com/search?q=%23LearnForFree&amp;src=hash">#<strong>LearnForFree</strong></a></p><p>Welcome back, In the previous article we learned about var , const and let. Now in upcoming articles we will learn about Datatypes in JavaScript. This article will look to cover <strong>Numbers</strong>.</p><p>Computer’s and data, these two words have an awesome relationship with each other. Inside the computer’s world, there is only data. Read the data, modify the data, create a new data — simply put, data is everything according to me when it comes to Programming.</p><p>Data is stored as long sequences of bits. Bits are those two-valued things, which are described as zeros and ones. Yes those <a href="https://www.mathsisfun.com/binary-number-system.html">binary numbers</a>, whatever you write in JavaScript, the JavaScript engines like Google’s V8 (Chrome) and Mozilla’s SpiderMonkey(Firefox) internally compile them to zeroes and ones aka Binary Numbers. Computer’s only understand binary, we write in JavaScript, that code get’s compiled in regular binary. “Write JavaScript, Compile it in Binary, Repeat.”</p><p>A typical modern computer has more than 30 billion bits in its volatile data storage. If you want to work with such quantities of bits without getting lost in it, you can separate them into chunks that represent pieces of information. In a JavaScript environment, those chunks are called values. Although all values are made of bits, they play different roles to each other.</p><p>Every value has a type that determines its role. There were six basic types of values in JavaScript: numbers, strings, Booleans, objects, functions, and undefined values. With ES6, a new type was born, called Symbol. In this article we will cover <strong>Numbers</strong> in JavaScript.</p><h3>Numbers</h3><p>Values of the number type are, unsurprisingly those numeric values. In JavaScript, we write them like this:</p><pre>var number = 12;</pre><pre>console.log(number); //=&gt; 12</pre><p>As I said before no magic here, this will cause the bit pattern for the number 12 to come into existence inside the computer’s memory. Unlike other programming languages. JavaScript uses a fixed number of bits, 64 of them to be precise. Here’s what <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures">MDN</a> says:</p><blockquote><em>According to the ECMAScript standard, there is only one number type: the </em><a href="http://en.wikipedia.org/wiki/Double_precision_floating-point_format"><em>double-precision 64-bit binary format IEEE 754 value</em></a><em>(number between -(253 -1) and 253 -1). </em><strong><em>There is no specific type for integers</em></strong><em>. In addition to being able to represent floating-point numbers, the number type has three symbolic values: +Infinity, -Infinity, and </em><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN"><em>NaN</em></a><em> (not-a-number).</em></blockquote><p>In JavaScript, numbers are represented as 64-bit floating point, the same as Java’s double. There is no separate integer type, so please remember that 1 and 1.0 are the same value. A number literal can be an integer, floating point, or (integer) hexadecimal. Please note that JavaScript interprets numeric constants as hexadecimal if they are preceded by 0x.</p><pre>let x = 3.14;     // Integer, a number with decimals</pre><pre>let y = 34;       // Floating point, A number without decimals</pre><pre>let z = = 0xFF;   // HexaDecimal, `z` will be 255</pre><pre>// Let&#39;s print/log them</pre><pre>console.log(x);</pre><pre>console.log(y);</pre><pre>console.log(z);</pre><p>Extra large or extra small numbers can also be written with scientific (exponent) notation:</p><pre>let a = 2.998e8;    // 2.998 × 10^8 = 299,800,000</pre><pre>let b = 123e-5;   // 123 x 10^-5 = 0.00123</pre><pre>// Let&#39;s print/log them</pre><pre>console.log(a);</pre><pre>console.log(b);</pre><p>The main thing to do with numbers is arithmetic. Arithmetic operations such as addition or multiplication take two number values and produce a new number from them. Here is what they look like in JavaScript:</p><pre>let c = 100 + 4 * 11;</pre><pre>console.log(c); //=&gt; 144</pre><p>Does that example mean “add 4 and 100, and multiply the result by 11”, or is the multiplication done before the adding? As you might have guessed, the multiplication happens first. But as in mathematics, you can change this by wrapping the addition in parentheses.</p><pre>let d = (100 + 4) * 11;</pre><pre>console.log(d); //=&gt; 1144</pre><p>Here are how will you do mathematical operations for addition, subtraction, multiplication, division, and remainder in JavaScript respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*yjA3ssS-ww-u353JPQfrXA.png" /></figure><p><strong>Special Numbers: </strong>There are three special values in JavaScript that are considered as numbers but don’t behave like normal numbers. The first two are Infinity and -Infinity, which represents the positive and negative infinities. Please note that Infinity — 1 is still Infinity, and so on. The value Infinity represents all values greater than 1.79769313486231570e+308.</p><p>I would urge you that you should not have trust in infinity-based computation as this isn’t mathematically solid, and it will quickly lead to our next special number: NaN.</p><p>NaN would stand for “not a number”. For example, when you are trying to calculate 0 / 0 (zero divided by zero), Infinity — Infinity, or any number of other numeric operations that don’t return an explicit, and meaningful result.</p><p><strong>Testing against NAN</strong>: NaN would compare unequal values (via ==, !=, ===, and !==… Don’t worry we will talk about these logical operators soon) to any other value — including to another NaN value. Use Number.isNaN() or isNaN() to explicitly determine whether value is NaN or not. You can also perform a self-comparison: NaN and only NaN will compare unequal to itself.</p><pre>console.log(NaN === NaN);        // false</pre><pre>console.log(Number.NaN === NaN); // false</pre><pre>console.log(isNaN(NaN));         // true</pre><pre>console.log(isNaN(Number.NaN));  // true</pre><pre>function valueIsNaN(v) {</pre><pre>return v !== v;</pre><pre>}</pre><pre>console.log(valueIsNaN(1));          // false</pre><pre>console.log(valueIsNaN(NaN));        // true</pre><pre>console.log(valueIsNaN(Number.NaN)); // true</pre><p>If you made it here to this paragraph, you are awesome. Next up we will cover <strong>Strings and ES6 Template Strings</strong>.</p><h3>References</h3><p>This story has been proudly referenced by these books below:</p><ul><li><a href="https://www.amazon.com/Eloquent-JavaScript-Modern-Introduction-Programming/dp/1593272820">Eloquent JavaScript</a></li><li><a href="https://www.amazon.in/JavaScript-Good-Parts-Crockford/dp/8184045220">JavaScript the Good Parts</a></li><li><a href="https://www.amazon.com/Understanding-ECMAScript-Definitive-JavaScript-Developers/dp/1593277571">Understanding ECMAScript 6</a></li></ul><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also CodeBurst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e7d8ea516a4" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/part-3-numbers-in-javascript-6e7d8ea516a4">Part 3 — Numbers in JavaScript</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 3: Bootstrap 4 vs Foundation 6.4 — Sass Workflow]]></title>
            <link>https://codeburst.io/part-3-bootstrap-4-vs-foundation-6-4-sass-workflow-73602fdc89b8?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/73602fdc89b8</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[bootstrap]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Sat, 23 Sep 2017 14:49:06 GMT</pubDate>
            <atom:updated>2017-09-24T13:33:13.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYWtDIwSREDFHsm_uoINaw.png" /></figure><p><em>Wait! Are you looking for Previous Articles in this series? Click here for </em><a href="https://codeburst.io/part-1-bootstrap-4-vs-foundation-6-4-the-grid-8c02747f14fb"><em>Part 1</em></a><em> and </em><a href="https://codeburst.io/part-2-bootstrap-4-vs-foundation-6-4-responsive-navigation-containers-f691cff8f06e"><em>Part 2</em></a><em> respectively.</em></p><h3>What is this Sass/SCSS in Web Design anyway?</h3><p>Sass is a preprocessor that will produce clean and efficient CSS code and will cut your development time to half (if not more). According to official <a href="http://sass-lang.com/">docs</a>,</p><blockquote><em>Sass is the most mature, stable, and powerful professional grade CSS extension language in the world. Sass is completely compatible with all versions of CSS. We take this compatibility seriously so that you can seamlessly use any available CSS libraries.</em></blockquote><h3>Advanced Sass &amp; Workflow!</h3><p>Foundation has great support for <strong>Sass functions and mixins. </strong>In fact, you can semantically build your own grid system too, and in both directions Horizontal or Vertical. As these features are awesome, these can’t be neglected in any mean and should be used in your next awesome website.</p><p>Unfortunately, though Bootstrap also uses Sass for generating the CSS for their framework but as of yet Bootstrap doesn’t have these features, and thus the <strong>comparison isn’t valid</strong>. If in case, Bootstrap will provide these features in upcoming future, I will surely update this article! … cc @<a href="https://medium.com/u/1b41c7ee2570">Johann S</a></p><h4><em>But I am sure, you like to learn Sass Workflow in Foundation atleast?</em></h4><p>I have gone ahead and created a separate <strong>2 part tutorial</strong> series about “<strong><em>Mastering Advanced Sass &amp; Workflow with Zurb Foundation”</em></strong>. Please check the links below:</p><p><a href="http://bit.ly/2xWFjON"><strong>Part 1</strong></a><strong>: Learn and Master Advanced Sass</strong></p><p><a href="http://bit.ly/2xWFjON">Mastering Advanced Sass &amp; Workflow with Zurb Foundation (Part 1)</a></p><p><a href="http://bit.ly/2fmyj6s"><strong>Part 2</strong></a><strong>: Sass Workflow with Zurb Foundation</strong></p><p><a href="http://bit.ly/2fmyj6s">Mastering Advanced Sass &amp; Workflow with Zurb Foundation (Part 2)</a></p><h3>Wait! Are you New to Sass?</h3><p>If in case, you are new to Sass and you can’t follow along with two above articles untill you learn the basics of Sass, then checkout this <a href="http://bit.ly/2xpMWKG">course</a> by Chris Sevilleja.</p><h3>To be continued…</h3><p>I hope you liked this article. Please <strong>check back soon</strong> as I will update this series to a <strong>7 Part</strong> Article Series for a comparison guide on <strong><em>Bootstrap 4 vs Foundation 6.4</em></strong> as listed below:</p><ul><li><a href="https://codeburst.io/part-1-bootstrap-4-vs-foundation-6-4-the-grid-8c02747f14fb"><strong>Part 1: The Grid (September 2, 2017)</strong></a></li><li><a href="https://codeburst.io/part-2-bootstrap-4-vs-foundation-6-4-responsive-navigation-containers-f691cff8f06e"><strong>Part 2: Responsive Navigation &amp; Containers <em>(September 4, 2017)</em></strong></a></li><li><strong>Part 3: Sass Workflow <em>(This Article)</em></strong></li><li><strong>Part 4: CSS Only Components <em>(Coming Soon)</em></strong></li><li><strong>Part 5: Typography &amp; CSS Utility Library <em>(Coming Soon)</em></strong></li><li><strong>Part 6: Javascript based Components <em>(Coming Soon)</em></strong></li><li><strong>Part 7: Javascript Plugins and Utilities <em>(Coming Soon)</em></strong></li></ul><p>As a learner, you might worry that these articles will become obsolete when Foundation releases <strong>version 7</strong> or Bootstrap releases <strong>version 5 </strong>and so on… but not to worry, I will update this series with every update so this is a <strong>series that should be bookmarked</strong>.</p><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also CodeBurst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73602fdc89b8" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/part-3-bootstrap-4-vs-foundation-6-4-sass-workflow-73602fdc89b8">Part 3: Bootstrap 4 vs Foundation 6.4 — Sass Workflow</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[2 Minutes Maggi] Vue.js Snippet — Simple Counter in 20 lines of JavaScript!]]></title>
            <link>https://codeburst.io/2-minutes-maggi-vue-js-snippet-simple-counter-in-20-lines-of-javascript-abc4d0e4259f?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/abc4d0e4259f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[foundation]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Thu, 21 Sep 2017 12:38:39 GMT</pubDate>
            <atom:updated>2017-09-21T12:38:39.431Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I am sharing a simple snippet which may help you with getting started in your Vue.js Journey. Enjoy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4IOnD1qcFlleY9_4-5gjw.png" /></figure><p>What does the counter do?</p><ol><li><strong>Simple Counter in Vue.js with Increase, Decrease and Reset buttons:</strong></li></ol><ul><li>Increase button will increase the counter until it crosses the limit. When it crosses the limit, it will stop. Currently set to <strong>20</strong> in the demo.</li><li>Decrease button will decrease the counter until it crosses the limit. When it crosses the limit, it will stop. Currently set to <strong>0</strong> in the demo.</li><li>Reset button will reset the counter to <strong>0</strong></li></ul><p><strong>2. Computed property to show the output as per the current value:</strong></p><ul><li>If the counter is less than 10, It will show <strong>less than 10</strong></li><li>If the counter is 10 or more, it will show <strong>10 or more</strong>.</li></ul><p><strong>Here is the Snippet!</strong></p><pre>new Vue({<br>  el: &#39;#app-root&#39;,<br>  data: { counter: 0, result: &#39;&#39; }, // Initial Value<br>  methods: {<br>    increaseCounter(increaseLimit) { // Increase<br>      if (this.counter &lt; increaseLimit) <br>        this.counter++;<br>    },<br>    decreaseCounter(decreaseLimit) { // Decrease<br>      if (this.counter &gt; decreaseLimit) <br>        this.counter--;<br>    }, <br>    resetCounter() { // Reset<br>      this.counter = 0;<br>    }<br>  },<br>  computed: {<br>    output() { // Output for computed property!<br>      return this.counter &gt;= 10 ? &#39;10 or more&#39; : &#39;Less than 10&#39;;<br>    }<br>  }<br>});<br></pre><p><strong>And, Here is the demo!</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FGMJxXN%3Fheight%3D600%26slug-hash%3DGMJxXN%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FGMJxXN&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.GMJxXN.small.6228b721-1445-47b6-9601-418f4f6218a3.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/412efd86d4c83a1cfd641a1d273528ba/href">https://medium.com/media/412efd86d4c83a1cfd641a1d273528ba/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abc4d0e4259f" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/2-minutes-maggi-vue-js-snippet-simple-counter-in-20-lines-of-javascript-abc4d0e4259f">[2 Minutes Maggi] Vue.js Snippet — Simple Counter in 20 lines of JavaScript!</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2: Var vs Const vs Let]]></title>
            <link>https://codeburst.io/part-2-var-vs-const-vs-let-69ea73fe76c1?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/69ea73fe76c1</guid>
            <category><![CDATA[variables]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es2015]]></category>
            <category><![CDATA[ecmascript-6]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Sun, 17 Sep 2017 18:57:41 GMT</pubDate>
            <atom:updated>2017-09-28T17:59:28.065Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is Part 2 for the Series <strong>“Modern ES6+ Javascript for those who know only a little about that old Javascript.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uKSqphvj9r712aKOujuZtQ.png" /><figcaption>Source: <a href="https://twitter.com/raganwald/status/564792624934961152">https://twitter.com/raganwald/status/564792624934961152</a></figcaption></figure><p><strong><em>Credits:</em></strong><em> This Part of the Article series has been referred from the </em><a href="https://leanpub.com/understandinges6/"><strong><em>book</em></strong></a><em> </em><strong><em>“</em></strong><em>Understanding ECMAScript 6 by Nicholas C. Zakas</em><strong><em>”.</em></strong></p><p>Cheers! This story has been republished and sponsored by <a href="http://bit.ly/2yJYHMo">tech.io</a><br><a href="https://twitter.com/search?q=opensourceknowledge&amp;src=hash">#<strong>opensourceknowledge</strong></a> <a href="https://twitter.com/search?q=%23LearnForFree&amp;src=hash">#<strong>LearnForFree</strong></a></p><p>Traditionally, the way variable declarations work has been that weird part of programming in JavaScript. Variables creation depend on how you declare them, and <strong>ES6</strong> offers options to make controlling scope easier. This article will look to clear on why those classic var declarations can be confusing and will also introduce block-level bindings aka const and let.</p><p>Variable declarations using var get treated as if they are at the top of the function (or global scope, if declared outside of a function) regardless of where the actual declaration occurs; this is called <strong>hoisting</strong>. See the example below to see what hoisting does:</p><pre>function getValue(condition) {<br>  if (condition) {<br>    var value = &quot;blue&quot;;<br>    // other code<br>    return value;<br>  } else {<br>    // value exists here with a value of undefined<br>    return null;<br>  }<br>  // value exists here with a value of undefined<br>}</pre><p>If you are new to JavaScript, you might think that the variable value only to be created if the condition evaluates to true. In fact, this is not how JavaScript engines work behind the scenes; the variable value gets created regardless as the engine changes the getValue function to look something like this:</p><pre>function getValue(condition) {<br>  var value;<br>  <br>  if (condition) {<br>    value = &quot;blue&quot;;<br>    // other code<br>    return value;<br>  } else {<br>    return null;<br>  }<br>}</pre><p>The declaration of value is hoisted to the top, while the initialization remains in the same spot. That means the variable value is still accessible from within the else clause. It happens to be like this as the variable would just have a value of undefined the other way around as it hasn’t been initialized.</p><p>It is obvious and understandable that will not be easy for new JavaScript developers to learn declaration hoisting, but please note that misunderstanding this unique behavior can end up causing bugs. To resolve this ES6 introduced block level scoping options to make the controlling a variable’s lifecycle a little more powerful.</p><h3><strong>Block-Level Declarations</strong></h3><p>Block-level declarations are the ones that declare variables that are far outside of a given block scope. Block scopes, also known as lexical scopes, are created either inside of a function or inside of a block (indicated by the { and } characters). 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><h4>Let Declaration</h4><p>The let declaration syntax is the same as var. You can replace var with let to declare a variable, this will limit the variable’s scope to only that current code block. Since let declarations are not hoisted to the top of the enclosing block, you may want always to place let declarations first in the block, so that they are available to the entire block. Here’s a quick example:</p><pre>function getValue(condition) {<br>  if (condition) {<br>    let value = &quot;blue&quot;;<br>    // other code<br>    return value;<br>  } else {<br>    // value doesn&#39;t exist here<br>    return null;<br>  }<br>  // value doesn&#39;t exist here<br>}</pre><p>Here below is the screenshot that shows the difference between var and let (Check the comments within the code block).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*14x2AVmAVC2NmkS7u4pK6g.png" /></figure><p>As you can see, the getValue function with let behaves similar to other programming languages. As, variable value is declared using let instead of var , the declaration isn’t hoisted to the top of the function definition, and the variable value is no longer accessible once execution flows out of the if block. If condition evaluates to false, then value is never declared or initialized.</p><h4>No Redeclaration</h4><p>If a identifier has already been defined within the scope, then using identifier in a let declaration inside that scope throws an error. Check below:</p><pre>var count = 30;</pre><pre>// Error: `count` has already been declared.<br>let count = 40;</pre><p>In this example, the count is declared twice: once with var and once with let. As let will not redefine an identifier that already exists in the same scope, the let declaration will throw an error.</p><p>On the other hand, no error shows up if the let declaration creates a new variable with the same name as a variable in its containing scope, check the code below:</p><pre>var count = 30;</pre><pre>if (condition) {<br>  // Does not throw an error<br>  let count = 40;<br>  <br>  // more code<br>}</pre><p>This let declaration does not throw any error as it creates a new variable called count within the if statement, instead of creating the count in the surrounding block. Inside the if block, this new variable shadows the global count, which prevents access to it until execution leaves the block.</p><h4>Constant Declarations</h4><p>Also, you can define variables in ES6 with the const declaration syntax. Variables that are declared using the const keyword are considered constants, which means that their values can’t be changed once set. Thus, each const variable must be initialized on the declaration, as shown below:</p><pre>// Valid constant<br>const maxItems = 30;</pre><pre>// Syntax error: missing initialization<br>const name;</pre><p>The maxItems variable is initialized, so its const declaration should work without any problems. The name variable, however, would cause a syntax error if you tried to run the program containing this code, because name is not initialized.</p><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also CodeBurst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69ea73fe76c1" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/part-2-var-vs-const-vs-let-69ea73fe76c1">Part 2: Var vs Const vs Let</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[2 minutes Maggi] Hello World App in Vue.js]]></title>
            <link>https://codeburst.io/2-minutes-maggi-hello-world-app-in-vue-js-cb3aa3591b83?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb3aa3591b83</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Fri, 15 Sep 2017 12:37:31 GMT</pubDate>
            <atom:updated>2017-09-15T12:37:31.951Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TByNGYl6CfURhReZmSCWug.png" /></figure><p>Vue.js is a progressive framework for building user interfaces. This is lean, this is fast, and unlike frameworks like React and Angular, it’s straightforward to get started. Here we will build a simple Hello World app, and it will just take 2 minutes for the whole process:</p><p>First of all please Import this JavaScript file: <a href="https://unpkg.com/vue">https://unpkg.com/vue</a><br>This fetches the latest version of Vue.js.</p><p>Then we will create a wrapper root div which will hold the app</p><pre>&lt;div id=&quot;app-root&quot;&gt;<br>  &lt;!-- HTML inside. --&gt;<br>&lt;/div&gt;</pre><p>Then, we will create a new Vue Instance, this will be an object, and then we will pass the above HTML into the DOM through an el key and app-root as value</p><pre>new Vue({<br>  el: &#39;#app-root&#39;<br>});</pre><h3>Hello World!</h3><p>Now, let’s insert a data key, and its value will be object. This object will then contain a title key with a value Hello World (or anything you would like)</p><pre>new Vue({<br>  el: &#39;#app-root&#39;,<br>  data: {<br>    title: &#39;Hello World!&#39;<br>  }<br>});</pre><p>Now, we will add a p tag, and inside it, we will wrap title with two curly braces. This is how Vue declaratively render’s the data. The Syntax {{}} is called <strong>String Interpolation</strong>.</p><pre>&lt;div id=&quot;app-root&quot;&gt;<br>    &lt;p&gt; {{ title }} &lt;/p&gt;<br>&lt;/div&gt;</pre><h3>Form Input</h3><p>Now we will pass an input tag with Vue <a href="https://vuejs.org/v2/guide/events.html">Event handler</a> v-on and pass changeTitle method inside it.</p><pre>&lt;div id=&quot;app-root&quot;&gt;<br>    &lt;input type=&quot;text&quot; v-on:input=&quot;changeTitle&quot;&gt;<br>    &lt;p&gt; {{ title }} &lt;/p&gt;<br>&lt;/div&gt;</pre><p>Now, we will create a methods object, insert a changeTitle function, pass the default javascript event argument. Within this object, we will pass this.title and equate it to event.target.value.</p><pre>new Vue({<br>  el: &#39;#app-root&#39;,<br>  data: {<br>    title: &#39;Hello World!&#39;<br>  },<br>  methods: {<br>    changeTitle(event) {<br>      this.title = event.target.value;<br>    }<br>  }<br>});</pre><p>That’s it, here is the final result:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FpWJwOZ%3Fheight%3D600%26slug-hash%3DpWJwOZ%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FpWJwOZ%3Feditors%3D1010&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.pWJwOZ.small.5fe70617-a970-466f-bae6-7b1da54492d6.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/cef72f93b1551a85d89479190d432bfb/href">https://medium.com/media/cef72f93b1551a85d89479190d432bfb/href</a></iframe><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also Codeburst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb3aa3591b83" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/2-minutes-maggi-hello-world-app-in-vue-js-cb3aa3591b83">[2 minutes Maggi] Hello World App in Vue.js</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sublime Text 3.0 Stable Version Released — Project has a New Icon too!]]></title>
            <link>https://codeburst.io/sublime-text-3-0-stable-version-released-have-a-new-icon-too-c20510fb1f15?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c20510fb1f15</guid>
            <category><![CDATA[sublimetext]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Thu, 14 Sep 2017 14:08:38 GMT</pubDate>
            <atom:updated>2017-09-15T08:52:58.330Z</atom:updated>
            <content:encoded><![CDATA[<p>I am very happy to let you guys know that Sublime Text 3.0 is out of the beta thing and its Stable version is released. The Build is version 3143 respectively. A lot has been improved since v2 and includes better performance. It’s notably faster than Sublime Text 2 in all areas of the project. The startup is faster, opening files is faster, and scrolling is more efficient than version 2. While it’s much larger an application than Sublime Text 2, but when you use it, you will found out that it feels leaner. Cheers!</p><p>All the improvements that have gone over 2 to 3 can be found <a href="https://www.sublimetext.com/2to3">here</a>. The Changelog and Download link can be found <a href="https://www.sublimetext.com/3">here</a>. Some key improvement within this versions compared to v2 includes:</p><blockquote>Certainly there are big features that 3.0 has: Goto Definition, a new syntax highlighting engine, a new UI, and an expanded API. However the difference is frequently felt in the hundreds of improvements that don’t warrant being featured on their own: spell checking works better, automatic indentation does the right thing more often, word wrapping handles source code better, high DPI screens are properly supported, and Goto Anything is smarter. There’s too much to list, but combined the difference is night and day.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a7wH4QE8ka8NW6jVmoicjA.png" /><figcaption><strong>Sublime Text 3.0</strong></figcaption></figure><h3>New Icon</h3><p>With releasing Version 3, Sublime team has also launched a new icon for the project. Here’s the new logo for the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*sCThsI10fk8kwNuARWdXxA.png" /><figcaption><strong>Sublime Text — New ICON</strong></figcaption></figure><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also Codeburst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c20510fb1f15" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/sublime-text-3-0-stable-version-released-have-a-new-icon-too-c20510fb1f15">Sublime Text 3.0 Stable Version Released — Project has a New Icon too!</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part1: Introduction to this weird Language called Javascript!]]></title>
            <link>https://codeburst.io/part-1-introduction-to-this-weird-language-called-javascript-7704b4931b86?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7704b4931b86</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript-development]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Tue, 05 Sep 2017 22:59:56 GMT</pubDate>
            <atom:updated>2017-09-28T17:39:46.670Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is Part 1 for the Series <strong>“Modern ES6+ Javascript for those who know only a little about that old Javascript.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1DWxwYJJcq-Id4D3HbJkIw.png" /><figcaption><strong><em>Image Source: Pexels</em></strong></figcaption></figure><p><em>Please note that this article assumes that you have little knowledge about JavaScript. Just a little… string, numbers, booleans… knowledge of variables will be good!</em></p><p>Cheers! This story has been republished and sponsored by <a href="http://bit.ly/2xzYihx">tech.io</a><br><a href="https://twitter.com/search?q=opensourceknowledge&amp;src=hash">#<strong>opensourceknowledge</strong></a> <a href="https://twitter.com/search?q=%23LearnForFree&amp;src=hash">#<strong>LearnForFree</strong></a></p><p>JavaScript is (by far) the most popular language on the web and open-source ecosystem. Created by Brendan Eich, though JavaScript’s popularity and significance can be regarded due to its interconnection with the browsers and JavaScript Engines, Google’s V8 (Chrome) and Mozilla’s SpiderMonkey(Firefox) engines are just so extremely optimized monsters.</p><blockquote>The gift of Eich, relegated for such a long time,<br>Will descend upon the great iron,<br>When the magical abilities of its scrolls<br>Become apparent to the Elixir Worshippers and the Gemstone Alchemists.</blockquote><p>But hey in Modern Javascript, it’s not only about browser. Although web browsers are still the most widely used platforms for JavaScript, but modern databases such as MongoDB use JavaScript as their scripting and query language. But the main thing which has made everyone nuts is that JavaScript is now providing a powerful platforms for apps to develop scalable <strong>server</strong> environments. Yes server, you listened it right! Wait, when I started I heard that HTML CSS JS is client and you use things like PHP for server. No ? Yes but things have changed now as all hail the NODE in this new era.</p><p>JavaScript is a very loosely-typed language and has been built around functions, dynamic objects, prototypal inheritance, and a powerful object literal notation. Like all other languages, it was built on very sound design principles but the problem was that unlike other languages, it had to evolve along with the browser. Web browsers support various features and standards and thus it tried to accommodate all the ideas that browsers made and unfortunately ended up making some very bad design decisions. These weird parts has overshadowed the good parts of the language for most people. Even now, this hasn’t changed even after the evolution of the web and JavaScript. Developer’s have written bad code, and other developer’s have had frightening experience trying to fix up that bad code and thus as a result, JavaScript got a very bad reputation. <a href="http://javascript.crockford.com/javascript.html">Douglas Crockford</a> have termed it as one of the most misunderstood programming languages.</p><h3>Functions in Javascript</h3><p>Functions are a base to JavaScript. If you can understand functions, then you just got the single most important weapon in your arsenal. The most important fact about functions is that in JavaScript, functions are first-class objects. They are treated like any other JavaScript object. Just like other JavaScript data types, they can be assigned to variables, array entries, and properties of other objects, declared with literals, be returned as values from functions, possess dynamically created properties and even passed as function parameters. They are the primary unit of execution and are the pieces where you would wrap all your code and is declared using a function literal. Here is a small example that will demonstrate how a function is declared.</p><pre>function add (harry, larry) {<br> return harry + larry;<br>}</pre><pre>const result = add(1993, 1973);<br>console.log(result); //prints 3966</pre><p>It all starts with a function keyword followed by the function name. Cool part is that the function name is optional and if there is no name given, it is said to be anonymous. Then there is harry and larry, they are actually parameters of the function which are wrapped in parentheses. These parameter’s are in the set of zero or more and has to be separated by commas. These names are defined as variables within the function, and instead of being initialized to undefined, they are initialized to the arguments supplied when the function is invoked.</p><p>And then there is return harry + larry wrapped in curly braces. That statement is actually body of the function and are executed when the function is invoked. This method is also known as <strong>function statement</strong>. When you are declaring functions like this, the content of the function get’s compiled and an object with the same name as the functions name is created. An another way of function getting declared is through <strong>function expressions.</strong></p><pre>var add = function (harry, larry) {<br>  return harry + larry;<br>};</pre><pre>const result = add(1973, 1993);<br>console.log(result);  //prints 3966</pre><p>As discussed, if there is no name given then that is an anonymous function. This anonymous function is getting assigned to an add variable and this variable is used to invoke the function same like in the earlier example. The problem with this style is that you can’t have recursive calls. Oh, Big word alert… Recursion! Recursion is a smart coding paradigm where the function calls itself. Back to the problem, Named function expressions can be used to to solve this limitation. For example,</p><pre>var result = function factorial(n) {<br> if (n &lt;= 1) {<br> return 1;<br> }<br> return n * factorial(n — 1);<br>};<br>console.log(result(4));</pre><p>As you can see that instead of creating an anonymous function, you will create a named function and as the function has a name, now it can call himself recursively. But the cool part I love about is the Self Invoked Functions. Here’s an example…</p><pre>(function greet() {<br>  console.log(&quot;Hello all from inside.&quot;);<br>})(); //=&gt; Self invoked!</pre><p>Please note that you can also self invoking functions like this.</p><pre>(function greet() {<br>  console.log(&quot;Hello all from inside.&quot;);<br>}()); //=&gt; I am Self invoked too!</pre><p>Did, you saw that difference (function greet(){…})(); instead of (function greet(){…}());. I hope you did, once defined, a function can be called in other JavaScript functions too. As the body of the function is executed, that code which get’s called and execute the function continues to execute. Funny enough, you can also pass a function as a parameter to an another function.</p><pre>//=&gt; Change to uppercase, gets executed with an `execute` function!</pre><pre>function changeToUpperCase(value) {<br> return value.toUpperCase();<br>}</pre><pre>//=&gt; `a` parameter is the string that get’s converted to uppercase<br>//=&gt; `passToAnother` get&#39;s referenced to the `changeCase()` function</pre><pre>function execute(a, passToAnother) {<br> console.log(passToAnother(a));<br>}</pre><pre>execute(‘harry’, changeToUpperCase); //=&gt; HARRY</pre><p>As, you can see that here we are passing a function reference as an argument to another function. Isn’t this cool? This function may or may not return a value. In above examples, we used an add function that returned a value through the code that is getting called up. Instead of returning a value at the end of the function, calling a return allows you to conditionally return from a function in an accurate manner.</p><pre>var omit5FromLoop = function(x){<br> if (x % 5 === 0) return;<br> console.log(x);<br>};</pre><pre>for(var i = 1; i &lt; 10; i++){<br> omit5FromLoop(i);<br>}</pre><p>This will return a loop like this below. If you see carefully there is no <strong>5. </strong>When the if (x % 5 === 0)condition is requested and returns true, the code simply returns from the function and the rest of the code is not called.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p1199PyyvasBulTmQP4zBA.png" /></figure><h3>Passing functions as Data</h3><p>Let’s start from scratch and create a variable validateData which will validate if the person’s age is less than 1 or greater than 99? If yes, the function will return true or else, will return false.</p><pre>var validateData = function(data) {<br> person = data();<br> console.log(person);<br> if (person.age &lt; 1 || person.age &gt; 99) return true;<br> else return false;<br>};</pre><p>Then we will create an error handler, so that this process a request if there is an error coming from validation.</p><pre>var errorHandler = function(error) {<br> console.log(“Error while processing age”);<br>};</pre><p>Then, we will create a request parser which will take three functions as arguments, these arguments are responsible for attaching the specifics together: the data, validator, and error handler.</p><pre>function parseRequest(data,validateData,errorHandler) {<br> var error = validateData(data);<br> if (!error) console.log(“no errors”);<br> else errorHandler();<br>}</pre><p>Now, we will generate a human and a robot which will be responsible for creating an object data through functions. In this example, the name is typed as a static term, whereas age is getting counted from a random number between 1 to 99.</p><pre>var generateHuman = function() {<br>  return {<br>    name: &#39;Harry Manchanda&#39;,<br>    age : Math.floor(Math.random() * (100 - 1)) + 1,<br>  };<br>};</pre><pre>var generateRobot = function() {<br>  return {<br>    name: &#39;Robot Singh Sidhu&#39;,<br>    age : Math.floor(Math.random() * (100 - 1)) + 1,<br>  };<br>};</pre><p>Now let’s parse the request and execute the functions</p><pre>parseRequest(generateHuman, validateData, errorHandler);<br>parseRequest(generateRobot, validateData, errorHandler);</pre><p>Here is the result that I got from the log, please note that age will vary due to random function inside the age key of an object function.</p><pre>{ name: ‘Harry Manchanda’, age: 16 }<br>no errors<br>{ name: ‘Robot Singh Sidhu’, age: 10 }<br>no errors</pre><p>Please note that parseRequest() function is fully extendable and in fact can be customised, will be invoked in every request, and because of that there is a single, clean debugging point. I hope by now you would have started to applause the power that JavaScript functions possess like a demon.</p><h3>Scoping in JavaScript</h3><p>If you want to work efficiently with JavaScript, understanding scope is very important. But the problem is that it’s slightly confusing. That said, I will try to resolve your doubts. Though these concepts may seem straight forward thanks to other languages but hey REMINDER, this is JavaScript! There are some subtle changes that must be understood so that you can master the concept. In JavaScript, the scope refers to the current context of code.</p><p>A variable’s scope is the context in which the variable exists. The scope help’s you to specify from where you can access a variable and whether you have access to the variable in that context or not? Scopes can be defined globally or locally.</p><p><strong>Global Scope<br></strong>Any variable that you declare by default is been defined in global scope. Yes yes, this is one of the most stupid language design based decision taken within JavaScript. A global variable is visible in all other scopes and can be modified by any scope. Unfortunately, a global variable is visible in all other scopes and can be modified by any scope thus making it harder to run the loosely combined sub-programs within the same program. If the sub-programs have one or more global variables that share the same name(s), then they will get involved with each other and likely fail, mostly in an unrecognizable manner and is known as namespace clash.</p><p><strong>Local Scope<br></strong>JavaScript doesn’t have block-level scope aka the variables scoped to surrounding curly brackets instead, the language have a function-level scope. The variables declared in a function are simply local variables and is only accessible within that function or by functions inside that function.</p><pre>var name = &#39;Harman Singh Manchanda&#39;; // Global Variable<br>function twitter () {<br>  var name = &#39;Harry Manchanda&#39;; // local variable<br>  console.log (name); <br>}<br>console.log (name); //prints - Global<br>twitter();         //prints – Local</pre><h3>Function-level scope versus block-level scope</h3><p>The JavaScript variables are scoped at function level. Think of this as a small bubble being created which prevents the variable to be visible from outside this bubble. Function creates such a bubble for variables declared inside the function.</p><pre>-GLOBAL SCOPE---------------------------------------------|<br>var g =0;                                                 |<br>function foo(a) { -----------------------|                |<br>    var b = 1;                           |                |<br>    //code                               |                |<br>    function bar() { ------|             |                |<br>        // ...             |ScopeBar     | ScopeFoo       |<br>    }                ------|             |                |<br>    // code                              |                |<br>    var c = 2;                           |                |<br>}----------------------------------------|                |<br>foo();   //WORKS                                          |<br>bar();   //FAILS                                          |<br>----------------------------------------------------------|</pre><pre><em>//=&gt; Source: Mastering Javascript </em></pre><p>As you can see the language uses the so called “scope chains” to establish the scope for a given function. That mean’s that there is typically one global scope, and each function defined below has its own nested scope. A function that defined in an another function has a local scope which is getting used up by linking up to an outer function. <strong>It’s always the position in the source that defines the scope. </strong>When it tries to resolve a variable, the language starts at the innermost scope and searches outwards.</p><p>Within the visual, you can easily see that the foo() function has been defined in the global scope. The foo() function has its own local scope and get’s accessed to the g variable because it&#39;s in the global scope. Buta, b, and c variables are available in the local scope as they are defined inside the function scope. The bar()function is also declared inside the function scope and thus is also available within the foo() function. So, as you can see once the function scope is over, the bar() function is just not available. You can’t see or call the bar() function from outside the foo() function—<a href="https://twitter.com/search?f=tweets&amp;q=%23aScopeBubble">#aScopeBubble</a>. As you can see that now, the bar() function also has its own function scope (bubble), I ask you what’s available ? The answer is that the bar()function have an access to the foo() function and all the variables been created in the parent scope of the foo() function—a, b, and c. The bar() function also has access to the global scoped variable, g.</p><p>Believe it or not but this is powerful. Please take a moment to think about it. We have just discussed how restricted and out of control global scope have gone in the language. What about if we take an random piece of code and wrap it around within a function? We will be able to hide and create a scope bubble around this piece of code. No? Creating the correct scope using function wrapping will only help us create correct code and prevent those difficult to detect bugs. An another advantage through this is that you are hiding variables and functions within this scope and thus, you can avoid those collisions between two identifiers. The following example shows such a bad case:</p><pre>function foo() {<br> function bar(a) {<br> i = 2; // changing the ‘i’ in the enclosing scope’s for-loop<br> console.log(a+i);<br> }<br> for (var i=0; i&lt;10; i++) {<br> bar(i); // infinite loop… run at your own risk<br> }<br>}<br>foo();</pre><p>In this bar() function, we are accidentally modifying the value of i=2 and thus, when we are looking to call bar() from within the for loop, value of the i variable is set to 2 and just never come out of an infinite loop. This won’t be wrong if i call this a bad case of namespace collision.</p><p>So far, we thought that using functions as a scope is a great way to achieve modularity and correctness within the language. Well, though this technique works, it’s not really not a great one. The first problem we are facing is that we must create a named function. If we keep on creating such functions just to introduce the function scope, we are polluting the global scope or the parent scope. Additionally, we will have to keep calling such functions. This introduces a lot of boilerplate code, which makes it hard for the code to be read properly as time passes by.</p><pre>var a = 1;<br>//=&gt; 1. Add a named function foo() into the global scope</pre><pre>function foo() { <br> var a = 2;<br> console.log( a ); // Print&#39;s 2<br>}</pre><pre>//=&gt; 2. Now call the named function foo()</pre><pre>foo();<br>console.log( a ); // Print&#39;s 1</pre><p>We just introduced the function scope by creating a new function foo() to the global scope and later on, called this function to execute the code.<br>As discussed little above, we can solve both these problems by creating functions that immediately get executed.</p><pre>var a = 1;<br>//=&gt; 1. Add a named function foo() into the global scope</pre><pre>(function foo() { <br> var a = 2;<br> console.log( a ); // Print’s 2<br> }) (); //=&gt; 2. this function `foo()` executes immediately<br>console.log( a ); // Print’s 1</pre><p>You would notice that the wrapping function statement is starting with a function. This means that instead of treating this function as a standard declaration, this function has been treated as a function expression. The (function foo(){ ... }) statement as an expression meant that the identifier foo is to be found only in the scope of the foo() function, and not in the outer scope. By hiding the name foo in itself would mean that it does not pollute the enclosing scope unnecessarily. This is so useful and far better. Thus we add () after the function expression to invoke it immediately. This pattern is the so called, <strong>Immediately Invoked Function Expression </strong>or<strong> IIFE. </strong>Mostly developer’s remove the function name whenever they use IIFE as the primary use of IIFE is to introduce function-level scope, and thus function naming is not required, really!</p><h3>Block scopes</h3><p>Please note that JavaScript just does not have the concept of block scopes. Developer’s coming from other languages such as Java or C can find this very odd and uncomfortable. <strong>ES6 </strong>introduces the <strong>let</strong> and <strong>const</strong> keywords to introduce traditional block scope. This is so incredibly convenient that in modern JavaScript, thanks to tools like babel, you are supporting ES6, and thus you should always use the let or const keyword. We will discuss let and const instead of var. That being said, this is not the right time to discuss that. It can soon go off the topic, we will discuss it in upcoming parts of this series. That being said, find an example of it below:</p><pre>var foo = true;<br>if (foo) {<br> let bar = 42; //variable bar is local in this block { }<br> console.log( bar );<br>}</pre><pre>console.log( bar ); // ReferenceError</pre><h3>Hoisting in Javascript</h3><p>Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. In layman’s term that simply means that no matter where your functions and variables are declared, they will be moved to the top of their scope regardless of whether their scope is global or local. It is a very strong feature in the language. It provides high flexibility to the language, if used properly and carefully. Please note that, having a strong understanding of scoping within the language can help you to avoid many common mistakes.</p><p>Let’s test you out, without running can you answer what this below code will print out to the console?</p><pre>var video = &#39;HTML5 is the present!&#39;;<br>if(true) {<br>  var video = &#39;Long live Flash&#39;;<br>}<br>console.log(video);</pre><p>If you said, ‘Long live Flash’… then good luck you either know hoisting, or you guessed it right. For other fellow’s I would like to tell that this is happening due to the function-level scoping in JavaScript within a variable declaration (using var keyword). It is very important to remember that only the declarations themselves are hoisted, while any assignments or other executable logic are left in place. For example,</p><pre>var video;<br>console.log(video); //=&gt; undefined</pre><pre>video = ‘HTML5 is the present!’;<br>if(true) {<br> var video = ‘Long live Flash’;<br>}</pre><pre>console.log(video); //=&gt; Long live Flash</pre><p>But hey, as told earlier that variables that are declared (using var keyword) are function-level scoped and the block-level scoping with loops and conditionals ( if,for, while, switch blocks) just does not determine the limits of the scope.</p><h4>ES6, you are awesome!</h4><pre>var structure = ‘HTML5 is the best!’;<br>let interactivity = ‘ES6 Rules’;<br>if (true) {<br> var structure = ‘Long live Flash’; //=&gt; scope is global<br> let interactivity = ‘ES5 Sucks’; //=&gt; scope is (local) block-level<br> console.log(structure); //=&gt; Print’s “Long live Flash”<br> console.log(interactivity); //=&gt; Print’s “ES5 Sucks”<br>}<br>console.log(structure); //=&gt; Print’s “Long live Flash”<br>console.log(interactivity); //=&gt; Print’s “ES6 Rules”</pre><p>Part 2 is all about this. Check back soon!</p><h3>Function declarations versus function expressions</h3><p>Functions can be defined in two ways, as Function declarations or function expressions and they both serve identical purposes but there is a difference between these two types of declarations.</p><p>Here is an example of Function expression, which returned a type error.</p><pre>functionOne();<br>//=&gt; TypeError: functionOne is not a function</pre><pre>var functionOne = function() {<br> console.log(&#39;Hey I am function no. 1&#39;);<br>};</pre><p>Here is an example of <strong>Function declaration</strong>, which printed out the logic.</p><pre>functionTwo();<br>//=&gt; Prints - functionTwo</pre><pre>function functionTwo() {<br>  console.log(&#39;Hey I am function no. 1&#39;);<br>}</pre><p>As you can see, a function declaration is processed when the execution enters the context in which it appears and before any step-by-step code is called. The function that it creates has been given a proper name functionTwo() and we are putting this name in the scope in which the declaration will appear. As it isprocessed before any step-by-step code in the same context, calling functionTwo() before defining it works without any error. But, functionOne() is an anonymous function expression, and is being assessed when it reaches the step-by-step execution of the code (also being called the runtime execution) and thus we have to declare it before we can invoke it. In layman terms, the function declaration of functionTwo() was hoisted while the function expression of functionOne() was executed when line-by-line execution encountered it.</p><p>But hey, if there is a thing to remember in this scenario then that is that you should never use function declarations conditionally. This behaviour is non-standardised and thus may behave differently across platforms. The following example shows such a scenario where we are trying to use function declarations conditionally by assigning different function body to function sayHello() but please remember that such a conditional code is not guaranteed to work across all browsers and mostly results in an unpredictable results.</p><pre>if (true) {<br> function sayHello() {<br> return ‘Harry is awesome!’;<br> }<br>}<br>else {<br> function sayHello() {<br> return ‘Harry is stupid!’;<br> }<br>}<br>foo();</pre><p>Never do this, different browsers will behave differently in this case. A function declaration should never be placed in the block. You should be using an function expression as it’s perfectly safe and in-fact a smart choice.</p><pre>if (true) {<br> sayHello = function () {<br> return ‘Harry is awesome!’;<br> };<br>}<br>else {<br> sayHello = function () {<br> return ‘Harry is stupid!’;<br> };<br>}<br>foo();</pre><p>The thing with declarations is that they are only allowed to appear within the program or function body. They cannot appear in a block { ... }. Weird, No? Yes but that’s just how JavaScript goes, the blocks are only allowed contain statements and not function declarations. Thus Function expressions, are very popular due to this weird stuff. The common pattern among JavaScript developer’s is that they fork the function definitions based on some kind of a condition. These forks usually happen in the same scope and thus is almost always necessary to use function expressions.</p><h3>Arguments Parameter</h3><p>An argument parameter is a collection of all the arguments passed to the function. A collection has a property named length that would contain the count of arguments, and the individual argument values can be obtained by using an array indexing notation. But hey, arguments parameter is not a JavaScript array and if you would try to use array methods on arguments, GOOD LUCK! Think of arguments as an array-like structure which is helping it to write functions that can take an unspecified number of parameters. See the below example:</p><pre>var sum = function () { <br> var i, total = 0;<br> for (i = 0; i &lt; arguments.length; i += 1) <br> total += arguments[i];<br> return total;<br>};<br>console.log(sum(1,2,3,4,5,6,7)); // print’s 28<br>console.log(sum(1,2,3,4)); // print’s 10</pre><p>Though, the arguments parameter is not really an array but it is possible to convert it to an array like below and once converted, you can manipulate the list as you wish.</p><pre>var args = Array.prototype.slice.call(arguments);</pre><h4>The this parameter</h4><p>Yes this, if you can say that you know the this keyword very well then Great, because I ain’t the one who can say that. But still I will try to explain in this context. Whenever a function is invoked, apart from parameters that represent the detailed arguments that were provided on the function call, an implicit (indirect) parameter named this is also passed to the function. This refers to an object that’s implicitly associated with the function invocation, commonly termed as a <strong>function context.</strong></p><p><strong>Invocation as a function:</strong> If a function is not invoked as a method, or as a constructor, or throughapply() or call(), then this is simply been invoked as a function. With this pattern, this is bound to the global object. I have heard a lot from many developer’s that this is a bad design choice. Of-course, this is natural to assume that this would be bound to the parent context. If would only say that if you are in a same situation, just capture the value of this in an another variable.</p><p><strong>Invocation as a method: </strong>A method is basically a function tied to a property on an object. For methods, this is bound to the object on invocation as shown in example below. As you can see, this is bound to the person object when invoked bygreet because greet is the method of person.</p><pre>var person = {<br>  name: &#39;Harry Manchanda&#39;,<br>  age: 24,<br>  greet: function () {<br>    console.log(this.name + &#39;, &#39; + this.age);<br>  }<br>};</pre><pre>person.greet();</pre><p><strong>Invocation as a constructor: Constructor</strong> functions get’s declared just like any other functions. No, there is nothing special about them. But, the way in which they are invoked is very different. To invoke the function as a constructor, we precede the function invocation with the <strong>new</strong> keyword. When this happens, this is bound to the new object. We will discuss about prototypal inheritance later but for now, just jot down that these contructor functions are designed to be called with the new prefix. For easier distinction, they are named using <strong>PascalCase</strong> as opposed to <strong>camelCase</strong>.</p><p>In below example, notice how the greet function uses this to access the name property. The this parameter is bound to Person.</p><pre>var Person = function (name) {<br>  this.name = name;<br>};</pre><pre>Person.prototype.greet = function () {<br>  return this.name;<br>};</pre><pre>var zuck = new Person(&#39;Mark Zuckerberg&#39;);<br>console.log(zuck.greet());</pre><p><strong>To be continued…</strong></p><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also Codeburst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7704b4931b86" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/part-1-introduction-to-this-weird-language-called-javascript-7704b4931b86">Part1: Introduction to this weird Language called Javascript!</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2: Bootstrap 4 vs Foundation 6.4 — Responsive Navigation & Containers]]></title>
            <link>https://codeburst.io/part-2-bootstrap-4-vs-foundation-6-4-responsive-navigation-containers-f691cff8f06e?source=rss-5b320fd57b1e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f691cff8f06e</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bootstrap]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Harry Manchanda]]></dc:creator>
            <pubDate>Mon, 04 Sep 2017 16:08:08 GMT</pubDate>
            <atom:updated>2017-09-23T15:09:58.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48Y6FKWRHglmparOMrAKMQ.png" /><figcaption><strong>Responsive Navigation &amp; Containers</strong></figcaption></figure><p><em>Wait! Are you looking for Part 1? </em><a href="https://codeburst.io/part-1-bootstrap-4-vs-foundation-6-4-the-grid-8c02747f14fb"><em>Click here</em></a><em>.</em></p><h3>What is Navigation in website design anyway?</h3><p>Website navigation is the process of helping a user to navigate between the content of a whole website. A navigation structure is one of the most important decisions you have to take up when you are planning a website design and thus it involves a higher level of abstraction than just sketching pages. It helps you organise on how you are going to guide visitors through your content. Placing hurdles in front of the visitors is the last thing you want in your website design and thus a site navigation structure and design always plays a very big role for gaining popularity among your visitors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*TMFwmGialBHznV6n5eklVg.png" /><figcaption><strong><em>Source: </em></strong><a href="http://www.bbc.co.uk/schools/gcsebitesize/dida/multimedia/designrev3.shtml"><strong><em>BBC</em></strong></a></figcaption></figure><p><strong>There are mainly two types of navigation in a website design:</strong></p><ol><li><strong>Main Navigation</strong>: This main navigation includes top level sections/pages of the website and thus would list the main content within a website. It is always better suited that these top level links are common everywhere. In short, it should always look that the whole website was made by a single person (even if this isn’t the case).</li><li><strong>Sub Navigation</strong>: After this process, these top level sections/pages contains a local navigation<strong> </strong>for that specific section which helps the user to navigate most (if not all) pages. Same like <strong>main navigation</strong>, it is always recommended that these section specific links should be common within the whole section of a website.</li></ol><p>Confused? See this image below to clear your confusions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nnf1L1CDL2f44Yn2es5cEA.png" /></figure><p>I am assuming that by now you would have understood what a navigation and sub-navigation actually is and what it does? Now let us compare navigation system’s of the top two open source web frameworks out there. We will cover not only Navigation’s like <strong>Topbar/Navbar, Accordion menu, Drill-down menu, Drop-down menu </strong>and<strong> Off-canvas </strong>but also navigable containers like <strong>Accordion, Tabs </strong>and <strong>Pills </strong>plus we will also discuss about additional navigation options like <strong>Pagination</strong> and <strong>Breadcrumbs</strong>. We will also talk about <strong>Responsive Navigation</strong> and also how to Prevent<strong> Flash of Unstyled Content </strong>in Foundation<strong>.</strong></p><p><strong><em>Disclosure</em></strong><em>: I am a Member/Proud </em><strong><em>YETINAUT</em></strong><em> of the Open Source Foundation Team but this post has been written without being biased. I have had my shared experience with both frameworks, and all opinions expressed here are my own.</em></p><h3>[Base] Navs/Menu’s</h3><p>Though these base menu’s just <strong>don’t give you final products</strong> instead they are the structure on the top of which Bootstrap or Foundation creates the common navigation patterns which we will look to discuss later after this <strong>base nav/menu section</strong>. Its basically the “scratch” from where you can create an awesome navigation system for your website.</p><h4><strong>Bootstrap 4: Base Nav</strong></h4><p>Navigation in Bootstrap share a general markup and styles, from the base .nav class for their active and disabled states. You can swap the modifier classes to switch between each style. The base .nav component was built with flexbox and thus provides a strong foundation for building all types of navigation components. Thanks to their Flexbox Utilities, Horizontal and Vertical Alignment are also supported.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FxLBOqQ%3Fheight%3D600%26slug-hash%3DxLBOqQ%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FxLBOqQ&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.xLBOqQ.small.708e04f4-51c1-478c-89a9-2e666c9fa58b.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6717e1c48536acad9f1efcf0ff38e74/href">https://medium.com/media/c6717e1c48536acad9f1efcf0ff38e74/href</a></iframe><h4>Foundation 6: Menu</h4><p>Foundation’s flexible menu component is an all-purpose component for navigation which helps you build many common navigation patterns, all with the same markup. It replaces Foundation 5’s inline list, side nav, sub nav, and icon bar, and thus unifying them into an all in one component. All versions of the menu are a &lt;ul&gt; filled with &lt;li&gt; elements containing links. Horizontal and Vertical Alignment are also supported.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FwqOWYd%3Fheight%3D600%26slug-hash%3DwqOWYd%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FwqOWYd&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.wqOWYd.small.48208e45-3e0d-41bf-b288-d3da480976df.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/e23796f3fdb39405629ca6cbc2e738fb/href">https://medium.com/media/e23796f3fdb39405629ca6cbc2e738fb/href</a></iframe><h3><strong>Navbar/Topbar</strong></h3><h4>Bootstrap 4: Navbar</h4><p>Bootstrap includes a powerful, responsive navigation header. It also includes the support for branding, navigation, and more, including the support for their accordion/collapse plugin. According to official <a href="https://getbootstrap.com/docs/4.0/components/navbar/">Bootstrap Docs</a>,</p><blockquote>Navbars require a wrapping .navbar with .navbar-expand{-sm|-md|-lg|-xl} for responsive collapsing and color scheme classes. Navbars and their contents are fluid by default. Use optional containers to limit their horizontal width. Navbars and their contents are built with flexbox, providing easy alignment options via utility classes. Navbars are responsive by default, but you can easily modify them to change that.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FeEXzOG%3Fheight%3D600%26slug-hash%3DeEXzOG%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FeEXzOG&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.eEXzOG.small.78eb8abc-f1b3-4e34-afd9-165614aa6a4a.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9241756b4de203ec001b947853b21cb/href">https://medium.com/media/b9241756b4de203ec001b947853b21cb/href</a></iframe><h4>Foundation 6: Topbar</h4><p>Foundation’s main focus has always been on structure rather than style and rightly so. The top bar is a simple wrapper around foundation’s flexible menu components but supports advanced and responsive layouts. A top bar can have two sections: a left-hand section .top-bar-left and a right-hand section .top-bar-right. On small screens, these sections stack on top of each other. According to official <a href="http://foundation.zurb.com/sites/docs/top-bar.html#advanced-layout">Foundation docs</a></p><blockquote>To set up a Responsive menu with toggle click trigger on mobile, first give your menu a unique ID. Next, add a title bar with the class .title-bar and the attribute data-responsive-toggle. The value of data-responsive-toggle should be the ID of the menu you&#39;re toggling. Lastly, add data-toggle to the element that will trigger the toggle. The value of data-toggle should also be the ID of the menu you&#39;re toggling.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FNvJrjd%3Fheight%3D600%26slug-hash%3DNvJrjd%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FNvJrjd&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.NvJrjd.small.d514437c-57f8-461d-a45a-ea8013a1b336.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef991170a178676c1f864651cfdb3d3c/href">https://medium.com/media/ef991170a178676c1f864651cfdb3d3c/href</a></iframe><h3>Dropdown Menu</h3><p><strong><em>Disclaimer</em></strong><em>: This comparison section shows both vertical and horizontal example for foundation whereas just shows horizontal example because Vertical Dropdown menu or Submenu’s isn’t supported in Bootstrap right now.<br></em><strong><em>Update</em></strong><em>: Just had a talk with one of the Core Team Member’s of Bootstrap, </em><a href="https://medium.com/u/1b41c7ee2570"><em>Johann S</em></a><em> and he has ensured me that this will be added in the future, maybe with the first stable release of Bootstrap 4. Cheers!</em></p><p><strong>Bootstrap 4: Navbar with Dropdown<br></strong>With Bootstrap, you can also utilize dropdown’s in your navbar .nav. Dropdown menus require a wrapping element for positioning, so always be sure that you use separate and nested elements for .nav-item and .nav-link as shown below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2Fyowazw%3Fheight%3D600%26slug-hash%3Dyowazw%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2Fyowazw&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.yowazw.small.a7693d16-fe67-475f-bbbf-df154ed84d6a.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/56a421cb877c4ca6e7c08ca8f39bb64b/href">https://medium.com/media/56a421cb877c4ca6e7c08ca8f39bb64b/href</a></iframe><h4>Foundation 6: Dropdown Menu</h4><p>You can change a basic menu into an expandable dropdown menu with their Dropdown Menu plugin. According to official <a href="http://foundation.zurb.com/sites/docs/dropdown-menu.html">Foundation docs</a></p><blockquote><strong>Set up:</strong> Dropdown menus build on the <a href="https://s.codepen.io/boomerang/iFrameKey-5a255233-860e-7ae0-5651-5139b092c4e5/foundation.zurb.com/sites/docs/">Menu</a> component’s syntax. Add the class .dropdown and the attribute data-dropdown-menu to the menu container to set up the dropdown.<br><strong>Activate:</strong> To create dropdown menus, nest a new &lt;ul&gt; inside an &lt;li&gt;. You can nest further to create more levels of dropdowns.<br><strong>Vertical:</strong> Add the .vertical class to the top-level menu to make it vertical. Sub-menus are automatically vertical, regardless of the orientation of the top-level menu.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FrzRMoV%3Fheight%3D600%26slug-hash%3DrzRMoV%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FrzRMoV&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.rzRMoV.small.42ae2f00-d77c-465f-8b96-f9ae9563b1cf.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/2dce5701a2ce0ee296062c551b4bc9e8/href">https://medium.com/media/2dce5701a2ce0ee296062c551b4bc9e8/href</a></iframe><h3>Accordion Menu</h3><p><em>Unfortunately, this feature isn’t out yet (as of core) within the Bootstrap Framework. That being said, again kudos to </em><a href="https://medium.com/u/1b41c7ee2570"><em>Johann S</em></a><em>, he has made a </em><a href="https://codepen.io/Johann-S/pen/WEmoeW"><em>quick codepen</em></a><em> for using it right now.</em></p><h4><strong>Foundation 6.4: Accordion Menu</strong></h4><p>You can change a basic vertical Menu into a expandable accordion menu with this Accordion Menu plugin. According to official <a href="http://foundation.zurb.com/sites/docs/accordion-menu.html">Foundation docs</a></p><blockquote>Accordion menus follow the basic Menu syntax of &lt;ul&gt;, &lt;li&gt;, and &lt;a&gt;. To convert a basic menu into an accordion, add the attribute data-accordion-menu. You probably also want it to be vertical, so add the class .vertical as well. Any &lt;a&gt; will behave like a standard link. However, any &lt;a&gt; paired with a nested &lt;ul&gt; menu will then slide that sub-menu up and down when clicked on.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FQMoGqw%3Fheight%3D600%26slug-hash%3DQMoGqw%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FQMoGqw&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.QMoGqw.small.ae71210b-9b9b-4238-986a-09910232878f.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2025b7392580dc2f1c160027c6b029d/href">https://medium.com/media/a2025b7392580dc2f1c160027c6b029d/href</a></iframe><h3>Drilldown Menu</h3><p><em>Unfortunately, this feature isn’t supported yet within the Bootstrap Framework.</em></p><p><strong>Foundation 6.4:</strong> <strong>Drilldown Menu<br></strong>Inspired from Apple iOS drill-down’s, this feature converts a series of nested lists into a vertical drilldown menu. According to official <a href="http://foundation.zurb.com/sites/docs/drilldown-menu.html">Foundation docs</a></p><blockquote>Drilldowns use the standard <a href="http://foundation.zurb.com/sites/docs/menu.html#nested-style">Menu</a> syntax, using &lt;ul&gt;, &lt;li&gt;, and &lt;a&gt;. Add data-drilldown to the root menu to set up the drilldown. To create sub-menus, place a &lt;ul&gt; <em>next to</em> an &lt;a&gt;. Clicking that &lt;a&gt; will then open the &lt;ul&gt; that it&#39;s next to. Any &lt;a&gt; without a submenu will function like a normal link.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FzdboWz%3Fheight%3D600%26slug-hash%3DzdboWz%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FzdboWz&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.zdboWz.small.fd8e6e60-b4ea-4983-91a5-4c16f26af370.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/a44e4fac31567763505665aa965b7e2e/href">https://medium.com/media/a44e4fac31567763505665aa965b7e2e/href</a></iframe><p>Foundation’s Drilldown Menu also supports <a href="https://codepen.io/IamManchanda/pen/mmKyrw"><strong>autoHeight</strong></a> and <a href="https://codepen.io/IamManchanda/pen/jmKEwX"><strong>ScrollTop</strong></a></p><h3>Responsive Navigation</h3><p><em>Unfortunately, this feature isn’t supported yet within the Bootstrap Framework.</em></p><h4>Foundation 6: Responsive Navigation</h4><p>Foundation’s three Menu patterns as discussed above together form like a Voltron into one responsive Menu plugin, which allows you to switch between patterns at different screen sizes. Confused, here is a video to help you understand the whole scenario.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmLiX230QVRM%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmLiX230QVRM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmLiX230QVRM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8dea462ddafd1b2eba4a018f395e9f59/href">https://medium.com/media/8dea462ddafd1b2eba4a018f395e9f59/href</a></iframe><p><a href="https://codepen.io/IamManchanda/pen/qmYKgJ">Let’s start from scratch</a>, the base menu’s have some responsive CSS classes built in, which allow you to re-orient a menu on different screen sizes. Then these menu can be augmented with one of three different plugins—dropdown menu, drilldown menu, or accordion menu. With this awesome responsive menu plugin, you can apply a default pattern to a menu, and then quickly change that pattern on other screen sizes. Some popular menu combination’s (but not limited to) includes:</p><ol><li><a href="https://codepen.io/IamManchanda/pen/jmKPdM"><strong>Drilldown Dropdown Menu</strong></a></li><li><a href="https://codepen.io/IamManchanda/pen/LyXBQz"><strong>Accordion Dropdown Menu</strong></a></li><li><a href="https://codepen.io/IamManchanda/pen/bWQjQP"><strong>Drilldown Accordion Menu</strong></a></li></ol><p><em>Please note that I haven’t removed FOUC from these pen’s so that we can understand the issue’s of </em><strong><em>Flash of Unstyled Content. </em></strong><em>Now, we will discuss on how to prevent this FOUC issue!</em></p><p><strong>Extra: Preventing FOUC: </strong>According to official <a href="http://foundation.zurb.com/sites/docs/responsive-navigation.html#preventing-fouc">Foundation docs</a></p><blockquote>Before the JavaScript on your page loads, you’ll be able to see both the mobile and desktop element at once for a brief second. This is known as a <a href="https://en.wikipedia.org/wiki/Flash_of_unstyled_content">flash of unstyled content</a>. There’s not an easy way for the framework to handle this for you, but you can add some extra CSS to account for it. So before the JavaScript loads, we want only the right element for that screen size to be visible.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e57e5b3b1271c54f826d9cd554b131e/href">https://medium.com/media/9e57e5b3b1271c54f826d9cd554b131e/href</a></iframe><blockquote>If you’re using Sass, you can write it like this:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53a7dfeadf432354130133ca93e31d49/href">https://medium.com/media/53a7dfeadf432354130133ca93e31d49/href</a></iframe><p>If this doesn’t help, then these <a href="https://github.com/zurb/foundation-sites/issues?utf8=%E2%9C%93&amp;q=fouc%20">Github Threads</a> or filling a new <a href="https://github.com/zurb/foundation-sites/issues/new">Github Issue</a> are your best bet.</p><h3>Magellan/Scrollspy</h3><h4>Bootstrap 4: Scrollspy</h4><p>Scrollspy let’s you automatically update the Bootstrap navigation or list group components based on scroll position to indicate which link is currently active in the viewport. According to official <a href="https://getbootstrap.com/docs/4.0/components/scrollspy/">Bootstrap docs</a></p><blockquote>Scrollspy has a few requirements to function properly, It must be used on a Bootstrap nav component or list group. Scrollspy requires position: relative; on the element you’re spying on, usually the &lt;body&gt;. When spying on elements other than the &lt;body&gt;, be sure to have a height set and overflow-y: scroll; applied. Anchors (&lt;a&gt;) are required and must point to an element with that id. When successfully implemented, your nav or list group will update accordingly, moving the .active class from one item to the next based on their associated targets.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FvJPgGq%3Fheight%3D600%26slug-hash%3DvJPgGq%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FvJPgGq&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.vJPgGq.small.ae84336e-340c-478b-a611-00275d30261b.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/78311dacbb310d8a8279151494bc3398/href">https://medium.com/media/78311dacbb310d8a8279151494bc3398/href</a></iframe><h4>Foundation 6: Magellan</h4><p>Magellan allows you to create navigation that tracks the active section of a page your user is in. You can then pair it with Foundation’s Sticky plugin to create a fixed navigation element. You can use Magellan with any navigation element, like Foundation’s <a href="http://foundation.zurb.com/sites/docs/menu.html">Menu</a> or even your own custom component. You just have to add the attribute data-magellan to the container, and links to specific sections of your page. Please note that each section will need a unique ID. Then, you can use sticky plugin to create a persistent navigation whether its a header or a sidebar.</p><p><em>If there is one thing that makes </em><strong><em>Foundation’s Magellan &gt; Bootstrap’s Scrollspy, </em></strong><em>then surely it would be the inbuilt </em><a href="http://foundation.zurb.com/sites/docs/smooth-scroll.html"><strong><em>Smooth Scroll</em></strong></a><em>. Unfortunately Bootstrap guy’s have been tentative to add this feature in the core as they feel that this can negatively impact things like </em><a href="https://github.com/twbs/bootstrap/issues/21498#issuecomment-270215088"><strong><em>hardware acceleration</em></strong></a><em>. I don’t agree.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FbrZggw%3Fheight%3D600%26slug-hash%3DbrZggw%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FbrZggw&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.brZggw.small.6cd6d484-b7d5-45ba-b081-b476df865e39.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/367857491a278700aec637c1dca96523/href">https://medium.com/media/367857491a278700aec637c1dca96523/href</a></iframe><h3>Off-canvas/In-canvas</h3><p><em>Unfortunately, this feature isn’t supported yet within the Bootstrap Framework.</em></p><h4>Foundation 6: Off-canvas/In-canvas</h4><p>Off-canvas layouts are a very common and useful pattern for both mobile and desktop layouts. The off-canvas panels gets positioned outside of the viewport and slide in when activated. Setting up an off-canvas layout in Foundation is super easy. This pattern is a well established mobile pattern for navigation which can then also be used up to create a responsive sidebar. It is so amazing that it can open from any direction, left, right, top, and bottom. Confused? See this video below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FRK_k__4Y4TU%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRK_k__4Y4TU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRK_k__4Y4TU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1aa252c925aeee832fee249af98a8d5/href">https://medium.com/media/c1aa252c925aeee832fee249af98a8d5/href</a></iframe><p>Unfortunately, it will be hard for me to give you all Off-canvas examples, within one codepen. Your best bet would be to check out this link =&gt; <a href="http://foundation.zurb.com/sites/docs/off-canvas.html">http://foundation.zurb.com/sites/docs/off-canvas.html</a></p><p>To explore more you can also check out these <a href="https://github.com/zurb/foundation-sites/tree/develop/test/visual/offcanvas">visual test cases</a>.</p><h3><strong>Accordion</strong></h3><p><strong>Bootstrap 4: Accordion/Collapse<br></strong>Collapse let’s you toggle the visibility of content with few classes and JavaScript plugins. Using Bootstrap’s <a href="https://getbootstrap.com/docs/4.0/components/card/">card</a> component, you can also extend the default collapse behavior to create an accordion.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FLjaxOv%3Fheight%3D600%26slug-hash%3DLjaxOv%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FLjaxOv&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.LjaxOv.small.2e8e6986-1b10-4c83-ad55-ac7756e973d6.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/65774debaf42b0e82e733cdb6f54ffb1/href">https://medium.com/media/65774debaf42b0e82e733cdb6f54ffb1/href</a></iframe><h4>Foundation 6: Accordion</h4><p>Foundation Accordion’s help you to organize and navigate between multiple documents within a single container. They can thus be used for switching between items in the container.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FWjzKqa%3Fheight%3D600%26slug-hash%3DWjzKqa%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FWjzKqa&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.WjzKqa.small.75553c1f-81a2-428b-bd2f-cb67b20826e2.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c6f15d2509d2e06494d45c80d510a4f/href">https://medium.com/media/0c6f15d2509d2e06494d45c80d510a4f/href</a></iframe><p>Foundation also support options like <a href="https://codepen.io/IamManchanda/pen/ybEErg">Multi Expand</a> and <a href="https://codepen.io/IamManchanda/pen/zwaaVp">All Closed</a></p><h3>Tabs &amp; Pills</h3><p><em>Unfortunately, pills isn’t supported yet within Foundation Framework.</em></p><p><strong>Bootstrap 4: Tabs and Pills<br></strong>You can take the base nav and add the .nav-tabs/.nav-pills class to generate a tabbed interface. You can then use them to create a tabbable regions within your content.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FVzRPVY%3Fheight%3D600%26slug-hash%3DVzRPVY%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FVzRPVY&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fm.cdpn.io%2Fscreenshot-coming-soon-small.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/501fcb3492329ce18d68373f395dca00/href">https://medium.com/media/501fcb3492329ce18d68373f395dca00/href</a></iframe><h4>Foundation 6: Tabs</h4><p>Same like accordions, tabs also help you to organize and navigate between multiple documents within a single container.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FwqOgRd%3Fheight%3D600%26slug-hash%3DwqOgRd%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FwqOgRd&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.wqOgRd.small.a912c0a0-37e5-43e2-9246-7deb145fa089.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a5080233f3fe749105da88d7a3da553/href">https://medium.com/media/5a5080233f3fe749105da88d7a3da553/href</a></iframe><h3>Responsive Accordion Tabs</h3><p><em>Unfortunately, this feature isn’t supported yet within the Bootstrap Framework.</em></p><p>Added in Foundation 6.3.0, you can now use the Markup of the Accordion or Tabs components to create your very own Responsive Accordion Tabs.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FFKzzaWR6j2M%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFKzzaWR6j2M&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFKzzaWR6j2M%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a770d8892443b2596e7b5198638e14bd/href">https://medium.com/media/a770d8892443b2596e7b5198638e14bd/href</a></iframe><p>Either the <a href="https://codepen.io/IamManchanda/pen/eWKPqE">Accordion Markup</a> or the <a href="https://codepen.io/IamManchanda/pen/mmKQVN">Tabs Markup</a> can be used to responsively switch between the two components within different sizes of a device. Please note that the accordion should have an id specified, but the plugin will automatically generate one if the id is omitted.</p><h3>Deeplinking (Accordion/Tabs/Magellan)</h3><p><em>Unfortunately, this feature isn’t supported yet within the Bootstrap Framework.</em></p><h4>Foundation 6: Deeplinking</h4><p>Tab’s, Accordion and Magellan are great at what they do by default but hey sometimes the content you’re linking to is only linking to the page that the content is on. It might (in some cases) leave your user feeling confused and skeptical. According to <a href="https://zurb.com/university/lessons/deep-linking-with-foundation-for-improved-discoverability">Zurb</a>,</p><blockquote>It’d be as if you were an Uber driver, dropping your customer off in a sketchy neighborhood they don’t know. It doesn’t matter that it’s only a block away from where they wanted. People want to go directly to where they need to be, so send users directly to the specific content they’re after. When content is hidden in a tab or accordion, a link to the page is not enough. Sure you can link to an id on a piece of content, but the immediate jump to the middle of another page may be jarring and confusing to your users. And what if the content is hidden in a tab that is not open. This is when deep linking comes into play.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeELmgBAMP1E%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeELmgBAMP1E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeELmgBAMP1E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/092210ecafc56cebad8843e1b3a485fd/href">https://medium.com/media/092210ecafc56cebad8843e1b3a485fd/href</a></iframe><p>Unfortunately, I can’t provide you guys codepen’s for this feature as discussed in the starting of the above video. Thus, I am attaching some Github links for the demo’s where you can see the demo code:</p><ol><li><a href="https://iammanchanda.github.io/deeplinking-examples/tabs.html">Deeplinking | Tabs</a></li><li><a href="https://iammanchanda.github.io/deeplinking-examples/accordion.html">Deeplinking | Accordion</a></li><li><a href="https://iammanchanda.github.io/deeplinking-examples/magellan.html">Deeplinking | Magellan</a></li></ol><p>The code for these examples can be found <a href="https://github.com/IamManchanda/deeplinking-examples">here</a>.</p><h3>Breadcrumb</h3><p>Breadcrumb’s help you indicate the current page location within a site by automatically adding separators via CSS.</p><h4>Bootstrap 4: Breadcrumb</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FOjqWem%3Fheight%3D600%26slug-hash%3DOjqWem%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FOjqWem&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.OjqWem.small.8eac8b7f-d5e2-4260-b130-c492db1cb960.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/a76c96012110dd029f8f2087b74b788b/href">https://medium.com/media/a76c96012110dd029f8f2087b74b788b/href</a></iframe><h4>Foundation 6: Breadcrumb</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FMmGeMx%3Fheight%3D600%26slug-hash%3DMmGeMx%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FMmGeMx&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.MmGeMx.small.37e5a3c7-031e-4976-a62e-6b5a810345dc.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3df7140bcb498fe68ec7e80c286e409/href">https://medium.com/media/a3df7140bcb498fe68ec7e80c286e409/href</a></iframe><h3>Pagination</h3><p>Pagination is a type of navigation that helps user to click through the pages of either a search result, eCommerce product list, or other related items.</p><h4>Bootstrap 4: Pagination</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FqXvrEB%3Fheight%3D600%26slug-hash%3DqXvrEB%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FqXvrEB&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.qXvrEB.small.f0ac605c-5a34-4cf6-bd85-1e38ec265890.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/185b46f498927ca08311c1b658ac8239/href">https://medium.com/media/185b46f498927ca08311c1b658ac8239/href</a></iframe><h4>Foundation 6: Pagination</h4><p>The cool thing about Foundation Pagination compared to bootstrap is that the items in a pagination list are display: inline-block, which makes centering them or aligning it to right side easy. Use their built-in .text-center/.text-right class, or simply add text-align: center|right.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fembed%2Fpreview%2FZJPeGV%3Fheight%3D600%26slug-hash%3DZJPeGV%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io%26embed-version%3D2&amp;url=https%3A%2F%2Fcodepen.io%2FIamManchanda%2Fpen%2FZJPeGV&amp;image=https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fi.cdpn.io%2F314812.ZJPeGV.small.31309867-c9c1-4005-bec6-938e9e8b7742.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/bd55a613dce14f4ed51b0c6f5c1ac864/href">https://medium.com/media/bd55a613dce14f4ed51b0c6f5c1ac864/href</a></iframe><h3>To be continued…</h3><p>I hope you liked this article. Please <strong>check back soon</strong> as I will update this series to a <strong>7 Part</strong> Article Series for a comparison guide on <strong><em>Bootstrap 4 vs Foundation 6.4</em></strong> as listed below:</p><ul><li><a href="https://codeburst.io/part-1-bootstrap-4-vs-foundation-6-4-the-grid-8c02747f14fb"><strong>Part 1: The Grid (September 2, 2017)</strong></a></li><li><strong>Part 2: Responsive Navigation &amp; Containers <em>(This Article)</em></strong></li><li><a href="https://codeburst.io/part-3-bootstrap-4-vs-foundation-6-4-sass-workflow-73602fdc89b8"><strong>Part 3: Sass Workflow (September 23, 2017)</strong></a></li><li><strong>Part 4: CSS Only Components <em>(Coming Soon)</em></strong></li><li><strong>Part 5: Typography &amp; CSS Utility Library <em>(Coming Soon)</em></strong></li><li><strong>Part 6: Javascript based Components <em>(Coming Soon)</em></strong></li><li><strong>Part 7: Javascript Plugins and Utilities <em>(Coming Soon)</em></strong></li></ul><p>As a learner, you might worry that these articles will become obsolete when Foundation releases <strong>version 7</strong> or Bootstrap releases <strong>version 5 </strong>and so on… but not to worry, I will update this series with every update so this is a <strong>series that should be bookmarked</strong>.</p><h3>Thanks a lot…</h3><ul><li><strong><em>If you liked my article and also my passion for teaching, please don’t forget to follow me and also CodeBurst by clicking the links below.</em></strong></li><li><strong><em>If you would like to hire me for your next cool project, or just want to say hello… my twitter handle is </em></strong><a href="http://bit.ly/tw-harry"><strong><em>@harmanmanchanda</em></strong></a><strong><em> for getting in touch with me! My DM’s are open to the public so just hit me up.</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f691cff8f06e" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/part-2-bootstrap-4-vs-foundation-6-4-responsive-navigation-containers-f691cff8f06e">Part 2: Bootstrap 4 vs Foundation 6.4 — Responsive Navigation &amp; Containers</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>