<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>#ES6 Archives - anteelo</title>
	<atom:link href="https://anteelo.com/tag/es6/feed/" rel="self" type="application/rss+xml" />
	<link>https://anteelo.com/tag/es6/</link>
	<description>Leading Digital Solution Firm</description>
	<lastBuildDate>Fri, 14 May 2021 18:32:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://anteelo.com/wp-content/uploads/2020/01/cantlogo.png</url>
	<title>#ES6 Archives - anteelo</title>
	<link>https://anteelo.com/tag/es6/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ECMAScript &#038; its Features</title>
		<link>https://anteelo.com/ecmascript-its-features/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ecmascript-its-features</link>
		
		<dc:creator><![CDATA[Anteelo Master]]></dc:creator>
		<pubDate>Sun, 07 Mar 2021 18:28:57 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[#ActionScript]]></category>
		<category><![CDATA[#Adode]]></category>
		<category><![CDATA[#ECMAScript]]></category>
		<category><![CDATA[#ES6]]></category>
		<category><![CDATA[#JavaScript]]></category>
		<guid isPermaLink="false">https://anteelo.com/?p=3322</guid>

					<description><![CDATA[<p>ECMAScript is a term commonly used by developers for coding standard but most of us don’t know how did it come into the picture and why do we need it? Imagine a world without a set of rules for coding. Everyone would be writing their own codes, will have their own set of rules and [&#8230;]</p>
<p>The post <a href="https://anteelo.com/ecmascript-its-features/">ECMAScript &#038; its Features</a> appeared first on <a href="https://anteelo.com">anteelo</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div align="justify">ECMAScript is a term commonly used by <a href="https://anteelo.com/">developers</a> for coding standard but most of us don’t know how did it come into the picture and why do we need it?</div>
<div align="justify"><img fetchpriority="high" decoding="async" class="aligncenter" src="https://res.cloudinary.com/practicaldev/image/fetch/s--sF4FouMg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qakqanq79z8exo4pu63y.jpg" alt="New Features in ECMAScript 2021 (with code examples) - DEV Community" width="406" height="225" /></div>
<div align="justify">
<p>Imagine a world without a set of rules for coding. Everyone would be writing their own codes, will have their own set of rules and when a new person enters the world of software development, he/she will never know which set of rules they need to follow. The situation will become chaotic!!</p>
<p>The same incident happened with Javascript. When Javascript was first created by Netscape then there was a war going on between all the browser vendors in the market. Microsoft implemented its own version of javascript in <a href="https://www.instagram.com/anteelodesign/">Internet Explorer and Mozilla</a> implemented its own. Similarly, other browser vendors implemented their own versions.</p>
<p>All this created a huge problem for the developers. One version ran fine on Netscape but was a total waste on Internet Explorer or Firefox.</p>
<p><b>To solve the cross-browser compatibility, Javascript was standardized by the ECMA international and that’s the reason it got the name ECMAScript. </b>All browsers eventually implemented ECMAScript (though it took a lot of time).</p>
<h2>How is Javascript related to ECMAScript</h2>
<p>JavaScript is actually the term most of the developers use for ECMAScript. Although there are other implementations available for ECMAScript like – JScript (Microsoft) and ActionScript (Adobe), but JavaScript has proven to be the best-known implementation of ECMAScript since it was first published.</p>
<p>Jeff Atwood (founder of Stack Overflow) coined the term “Atwood’s Law,” which states:</p>
<blockquote><p><b><i>“Any application that can be written in JavaScript, will eventually be written in JavaScript. “</i></b></p></blockquote>
<p>It’s more than ten years now, and Atwood’s statement still lingers on. JavaScript is continuing to gain more and more adoption. The “next generation” of Javascript is something known as ES6 (The 6th edition, officially known as ECMAScript 2015).</p>
<p><img decoding="async" class="aligncenter" src="https://miro.medium.com/freeze/max/600/1*_FOV6txTo25KQ8NmPdbliQ.gif" alt="JavaScript==ECMAScript?. I'd like to begin this article by… | by Shreya Prasad | Medium" width="413" height="275" /></p>
<h2>6th Edition – ECMAScript 2015</h2>
<p>The 6th edition, officially known as ECMAScript 2015 is different because it introduces new syntax. Infact, a lot of new syntaxes.</p>
<p>Browser support for ES6 is still incomplete. However, <b>we can still use ES6 features </b>by using a pre-processor like <i>Babel</i> to cross-compile our JavaScript back to ES5 compatible code for older browsers, so there’s no reason to put off learning about it.</p>
<p>This update added arrow functions, promises, let and const, classes and modules and a lot of new features, but defines them semantically in the same terms as ECMAScript 5 strict mode. The complete list of new features can be found on http://es6-features.org</p>
<p><img decoding="async" class="aligncenter" src="https://www.swiftcoding.com/images/courses/ecmascript6.jpg" alt="Learn ECMAScript 6 - Deep Understanding - Swiftcoding.com" width="513" height="289" /></p>
<p>Some of the new features that are introduced in ES6 –</p>
<h5>Default Parameters</h5>
<p>We do not need to worry about parameters taking 0 or undefined value since we can define defaults in the parameters’ list now. This also saves the overhead of sending parameters to each function call when we wish to use the defaults.</p>
<h5>Block-Scoped Let and Const</h5>
<p>‘let’ is a new ’var’ which restricts the scope of the variable to a block instead of the whole function. With ‘const’, things are easier. It’s just an immutable entity, and at the same time block-scoped like let.</p>
<h5>Template Literals</h5>
<p>It determines the way to output or append variables in a string. Now we have a simple bash-like syntax that makes the code look prettier.</p>
<h5>Multi-line Strings</h5>
<p>When writing a multiple line string, ES6 save a lot of typing efforts by its new syntax that uses ‘backticks’.</p>
<h5>Destructuring Assignment</h5>
<p>It provides intuitive and flexible destructuring of Arrays and Objects into individual variables during assignment so we do not need to write extra code for the assignment task.</p>
<h5>Arrow Functions</h5>
<p>Arrows are shorthand for functions using the =&gt; syntax. They are syntactically similar to C#, Java 8 and CoffeeScript arrows. Arrows would make your ‘this’ behave properly, i.e., ‘this’ will have the same value as in the context of the parent function – it won’t mutate.</p>
<h5>Promises</h5>
<p>Promises provide the representation of a value that may be made asynchronously available in the future. We can also combine one or more promises into new promises without worrying about the order of the underlying asynchronous operations.</p>
<h5>Classes</h5>
<p>ES6 provides more intuitive, OOP-styled and boilerplate-free classes. These classes encourage the prototype-based object-oriented pattern which brings support for inheritance, constructors, static methods and more.</p>
<h5>Modules</h5>
<p>ES6 includes a built-in module system which provides support for exporting values from modules and importing values to modules within the javascript code and without polluting the global namespace.</p>
<h5>Spread Operator</h5>
<h5>The spread operator is an interesting way to build new arrays based on the values of existing arrays. It can:</h5>
<ul>
<li>Copy an array</li>
<li>Concatenate arrays</li>
<li>Insert new items into arrays</li>
</ul>
<h3>7th Edition – ECMAScript 2016</h3>
<p>The 7th edition, officially known as ECMAScript 2016, was finalized in June 2016. New features include the exponentiation operator (**) and Array.prototype.includes.</p>
<h5>Array.prototype.includes</h5>
<p>The includes() method determines whether an array includes a certain element or not, returning true or false as accordingly.</p>
<h5>Exponentiation Operator</h5>
<p>The exponentiation operator works same as exponentiation in mathematics, it returns the result of raising first operand to the power second operand. For example – 5^10 or 7^12</p>
<h3>Conclusion</h3>
<p>There are a number of really great language-centric reasons to start writing your code in ES6 and ES7 now, but there isn’t enough room in a single blog post to enumerate them or go into the nuances of how they will make your life better.</p>
</div>
<p>The post <a href="https://anteelo.com/ecmascript-its-features/">ECMAScript &#038; its Features</a> appeared first on <a href="https://anteelo.com">anteelo</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Developing App? Here&#8217;s Angular Practices &#038; Tips</title>
		<link>https://anteelo.com/developing-app-heres-angular-practices-tips/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=developing-app-heres-angular-practices-tips</link>
		
		<dc:creator><![CDATA[Anteelo Master]]></dc:creator>
		<pubDate>Thu, 21 Jan 2021 14:50:23 +0000</pubDate>
				<category><![CDATA[App Development]]></category>
		<category><![CDATA[#Angular]]></category>
		<category><![CDATA[#AngularJS]]></category>
		<category><![CDATA[#app]]></category>
		<category><![CDATA[#CSS]]></category>
		<category><![CDATA[#DevelopingApp]]></category>
		<category><![CDATA[#ES6]]></category>
		<category><![CDATA[#LazyLoading]]></category>
		<guid isPermaLink="false">https://anteelo.com/?p=3310</guid>

					<description><![CDATA[<p>Angular has been the most famous javascript framework among the developer community. It’s an MVC framework which provides pre-built components for developing the software application.Angular(2+) is based on Typescript , which is a superset of JavaScript. It comes with its most important advantage of static type checking that provides compile-time checking for any variable declarations and definitions.This [&#8230;]</p>
<p>The post <a href="https://anteelo.com/developing-app-heres-angular-practices-tips/">Developing App? Here&#8217;s Angular Practices &#038; Tips</a> appeared first on <a href="https://anteelo.com">anteelo</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div align="justify">
<p>Angular has been the most famous javascript framework among the <a href="https://anteelo.com/">developer</a> community. It’s an MVC framework which provides pre-built components for developing the software application.Angular(2+) is based on Typescript , which is a superset of JavaScript. It comes with its most important advantage of static type checking that provides compile-time checking for any variable declarations and definitions.This blog is based around some best practices for Angular which I figured out while developing <a href="https://www.instagram.com/anteelodesign/">applications</a>. There are also some bonus tips which I believe would help you with Angular development.</p>
<p><img loading="lazy" decoding="async" class="aligncenter" src="https://1z1euk35x7oy36s8we4dr6lo-wpengine.netdna-ssl.com/wp-content/uploads/2020/08/zymr8_steps_the_mobile_app_dev_lifecycle_cover.jpg" alt="Essentials of mobile app development lifecycle that appreneurs must know - Business of Apps" width="470" height="286" /></p>
<p><img loading="lazy" decoding="async" class="aligncenter" src="https://creativetimblog.com/blog/wp-content/uploads/2017/03/AngularJS-e1487056257254-730x410.png" alt="Major Factors That Authenticate The Use Of AngularJS - Creative Tim's Blog" width="458" height="257" /></p>
<h2>Follow the component based approach</h2>
<p>Angular comes with the component-based paradigm which is also one of its best practices. It helps in maintaining modular and readable code.</p>
<p>While developing an angular code, if you think that something can be used multiple times as an independent piece of code, make it a component. A very basic example can be a simple dropdown which shows a list of options. The drop-down can act as an independent component with its own methods and template.</p>
<p>Few more examples could be – breadcrumbs for navigating throughout our web application, a simple alert box showing error/success messages or a loader. We tend to ignore these while thinking of modular approach but all these above examples can be thought of as independent components which can be reused over and over again.</p>
<h2>Avoid using one huge global CSS</h2>
<p>Angular’s current structure includes individual folder for every component. This folder includes-</p>
<ul>
<li><b>.ts</b> file for component logic</li>
<li><b>.html</b> file</li>
<li><b>.css</b> file for the component</li>
</ul>
<p>So, keeping all of your CSS in one common CSS file would not only make your code less readable, it would make it less maintainable.</p>
<p>The best approach to style your components is to separate the global CSS with the local CSS (here local CSS refers to the component CSS). You should write your CSS in global CSS only when the CSS is written for the entire application and then if you need to style your component specific to a certain page, you can surely write in the local CSS.</p>
<h2>Use CSS preprocessors for faster development</h2>
<p>We can also use CSS preprocessors like SCSS/SASS for our Angular projects and I prefer them instead of writing plain CSS as they provide a lot of advantages over writing plain CSS. To mention one, the use of partials so that you can also separate your styles into multiple files for maintainability. If you guys want to know about partials, I would suggest you to go through this link.</p>
<p>You can divide your styling into multiple SCSS files just as we divide our application into multiple components. SCSS/SASS helps in writing smaller code which would ultimately get converted into CSS. So, why not save time and use it to our advantage.</p>
<p><img loading="lazy" decoding="async" class="aligncenter" src="https://psdtowp.net/modules/blog/uploads/image/css-preprocessors.jpg" alt="CSS preprocessors | PSDtoWP.net" width="618" height="247" /></p>
<h2>Save your time by using build tools</h2>
<p>Tools like angular-cli have come up as a lifesaver for angular developers. It’s basically a boilerplate for an Angular application which helps in quickly setting up the angular application for your new project. It comes with all dependencies required for building your application and also has an inbuilt webpack which helps in bundling all your code and assets. Angular CLI helps to increase developers productivity through scaffolding by creating a component file, template file, stylesheet file etc. It comes with few basic commands which help in faster development like:-</p>
<ul>
<li><em><strong>ng g component my-new-component</strong></em> – it will create a new component with the name my-new-component.</li>
<li><em><strong>ng g service my-new-service</strong></em> – it will create a new service with the name my-new-service.</li>
<li><em><strong>ng g module my-module</strong></em>  – it will create a new module. A module is basically a collection of components which help to serve or attain a particular functionality.</li>
</ul>
<h2>Use ES6 paradigm and approach</h2>
<p><img loading="lazy" decoding="async" class="aligncenter" src="https://s3.amazonaws.com/fullstackfeed/images/es6-2.jpg" alt="Interfaces in Vanilla ES6 JavaScript – Full-Stack Feed" width="428" height="217" /></p>
<p>Though right now ES-8 is the current drafted version for ECMAScript but ES-6 came up with its own new features that are still widely used by developer community as they produce the same results with fewer lines of code and for best practices, every developer should know how to use them.</p>
<ul>
<li><b>Arrow Function</b> – In javascript, we use this keyword to refer to the current execution context. Previously, when we had to write javascript functions, this keyword would refer to the function context and we had to use a temporary variable to store the current execution context, so that we never lose it but with the arrow functions, the current execution context is never lost. For e.g., we could use an arrow function like this;</li>
</ul>
<blockquote><p>// ES5</p>
<p>var sum = function(x, y) { return x + y };</p>
<p>// ES6 (arrow function)</p>
<p>var sum = (x, y) =&gt; { return x + y };</p></blockquote>
<p>Now, see the ES6 arrow function is just so compact and easy to understand and we can easily use this keyword inside this function to refer to the current execution context.</p>
<ul>
<li><b>Template Literals – Template literals have come up with how we deal with printing strings having dynamic content.</b></li>
</ul>
<p>For example, without template literals if we had to print a hello and goodbye message to a person, we would write something like :</p>
<blockquote><p>const name = ‘AMAL’</p>
<p>console.log(‘Hello ’ + name +’ !’);</p>
<p>console.log(‘Goodbye ‘ + name + ‘ !’);</p></blockquote>
<p>Now using template literals, it would be something like this:</p>
<blockquote><p>const name = ‘AMAL’</p>
<p>console.log(`Hello ${name} !`);</p>
<p>console.log(`Goodbye  ${name} !`);</p></blockquote>
<p>Now, who wouldn’t like to use the second syntax as it’s really easy to use and we don’t have to care about putting the spaces at right places so that the formatted output is correct.</p>
<p>Apart from these, <b>const</b> and <b>let</b> keywords came up as a replacement for global var variable so as to enable effective scoping of variables.</p>
<p>For a detailed overview of ES6 features, I would recommend having a glance over this.</p>
<h2>Use Lazy Loading wherever possible</h2>
<p><img loading="lazy" decoding="async" class="aligncenter" src="https://www.imperva.com/learn/wp-content/uploads/sites/13/2019/01/Lazy-Loading-2.jpg" alt="What is Lazy Loading | Lazy vs. Eager Loading | Imperva" width="485" height="304" /></p>
<p>Lazy loading is based around loading modules only when you want them to show.</p>
<p>We know about Angular’s modular architecture where a code is divided into modules with each module having its own components.</p>
<p>These components are basically views which might have some dynamic data. These components are rendered with the help of angular routing.</p>
<p>Lazy loading is one of the best things that angular framework comes with.</p>
<p>It’s based around one principle – ‘<b>load/use it when you need it</b>’. Oh, yeah what a lame<br />
explanation I’ve given. There is a <b>routing.ts</b> file in every module which defines a URL for rendering each and every component.</p>
<p>Now when it comes to implementing lazy loading technique, what we do is we define a routing file for each and every module and we import each module only when the URL changes and it corresponds to rendering a component defined in the routing file of that module.</p>
<p>This technique requires a bit of patience to learn but take my words, it’s worth implementing. I can tell you with my personal experience; we reduced the loading time of our website by 3-5 seconds by implementing lazy loading.</p>
<p>Previously, we imported the whole bundle each and every time the user hit our website URL making our site slow while rendering. Then after implementing lazy loading, we only imported the module containing component required to render our index page and we just loaded other modules only based on what URL the user is switching to.</p>
<p>The Angular docs surely cover the lazy loading technique and it’s worth reading. You can check this link to learn more about it.</p>
<h2>Follow DRY principle, extensively use services and directives</h2>
<p><strong>Services</strong></p>
<p>DRY – This keyword is very famous in the developer community and it just stands for <b>Don’t Repeat Yourself</b>. So, when writing any code- be it Angular or any language- if you feel that you are basically writing or repeating the same code in every component, then you must pause then and there and rethink whether the code can be placed at a suitable place and can be shared by every component.</p>
<p>For example, if you want to call an API that updates user data, don’t call it in every component. What I would do it, I would rather make a service for it in the .service.ts file and would call that function whenever I need any component.</p>
<p>Also, it serves the purpose of using services in angular. Services help us in saving and fetching data and also help us write common functions which could be used by multiple components.</p>
<p><strong>Directives</strong></p>
<p>Now switching over to <b>directives</b>. A directive is a piece of code which is used to perform a specific task. Directives are of 3 types in Angular – component, structure, attribute.</p>
<ul>
<li>Components are as we all know templates with logic to handle data.</li>
<li>Structure directives modify DOM by adding or removing an element.</li>
<li>Attribute directives change appearance or behavior of an element.</li>
</ul>
<p>Once, I was wondering to restrict input elements to accept only numbers when a user types in for a phone number field which shouldn’t accept alphabets. For this, I built an only number directive which would only allow input elements to accept numbers through the keycode. So just by using this directive as an attribute on an HTML input element, I can modify/change its behavior.</p>
<p><b>Conclusion</b></p>
<p>Following best practice is never a compulsion. There are many ways of doing things and you may choose any path. However, using best practices mean that you are following a method or a technique which is tried and tested through experiments and has proved to be effective to attain desired results.</p>
</div>
<p>The post <a href="https://anteelo.com/developing-app-heres-angular-practices-tips/">Developing App? Here&#8217;s Angular Practices &#038; Tips</a> appeared first on <a href="https://anteelo.com">anteelo</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
