<?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>Web Development Archives - Postnidea</title>
	<atom:link href="https://www.postnidea.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.postnidea.com/category/web-development/</link>
	<description>Programming Blog, Tutorials, jQuery, Ajax, PHP, MySQL and Demos</description>
	<lastBuildDate>Tue, 27 May 2025 09:12:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.8</generator>

<image>
	<url>https://www.postnidea.com/wp-content/uploads/2019/08/favicon.ico</url>
	<title>Web Development Archives - Postnidea</title>
	<link>https://www.postnidea.com/category/web-development/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>A Refreshing Dive into JavaScript ES6 Concepts</title>
		<link>https://www.postnidea.com/a-refreshing-dive-into-javascript-es6-concepts/</link>
		
		<dc:creator><![CDATA[Rakesh Kumar]]></dc:creator>
		<pubDate>Wed, 06 Nov 2024 11:38:33 +0000</pubDate>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Jquery]]></category>
		<guid isPermaLink="false">https://www.postnidea.com/?p=269</guid>

					<description><![CDATA[<p>JavaScript ES6 concepts and principles are fundamental. Nowadays new modern javascript libraries and frameworks use these concepts. ES6 concepts, covering [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/a-refreshing-dive-into-javascript-es6-concepts/">A Refreshing Dive into JavaScript ES6 Concepts</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>JavaScript ES6 concepts and principles are fundamental. Nowadays new modern javascript libraries and frameworks use these concepts. ES6 concepts, covering variables and data types, functions, arrays and objects, control flow and loops, error handling, scope and closures, and DOM manipulation. Each section provides an in-depth explanation with examples to help you understand these fundamental aspects of JavaScript. Nowadays React <a href="https://www.postnidea.com/angular-6-tutorial-for-routing-and-navigation/" target="_blank" rel="noreferrer noopener">Angular</a> and other javascript technologies are using these core practices. By mastering the fundamentals of JavaScript ES6, you&#8217;ll be equipped with the knowledge and skills to write clean, maintainable code and tackle more advanced JavaScript concepts with confidence. So, let&#8217;s dive in and unlock the power of JavaScript ES6 together!</p>



<h2 class="wp-block-heading">Difference between var, let &amp; const</h2>



<p>By using <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">var</mark></code> old way of defining variables. But javascript still maintains this type of syntax so, that old written code can also be executed and run by language because after an update each code updates a crucial thing.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>var p_name = &quot;jhon&quot;;
console.log(p_name); // will print jhon
p_name = &quot;Rahul&quot;;
console.log(p_name); // will print Rahul
var p_name=&quot;Ramesh&quot;;
console.log(p_name);</code></pre></div>



<p>In the above code, you can see it different way of defining var. The var is globally scoped so, you can define its top, and can be modified anywhere wherever required let me explain by example.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>var username = &quot;Jhon&quot;;
var age = 24;
if (age &gt; 23) {
    var usename = &quot;Mosh&quot;; 
}
console.log(usename) // Will print &quot;Mosh&quot;</code></pre></div>



<p>In the above example, you can see that we have defined a username and in the if statement block is modified and can be accessed outside the block and able to print it. But in the case of let and const this will not happen because both are block scoped so, will able to access within the block the same thing let me explain to you by example.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>let username = &quot;Jhon&quot;;
let age = 24;
if (age &gt; 23) {
     let usename = &quot;Mosh&quot;; 
}
console.log(usename) // Will print usename is not defined</code></pre></div>



<p>If we print the username then will throw an error because we again define in if block and it is block-scoped and their scope ends there if we do not again initialize with let in if block then will not throw an error. You can initialize a single time and can modify the value anywhere.</p>



<p>The const works the same as the variable but the main difference is that their value can not be modified within the block or outside the block in this datatype you can add value a single time and will same throughout the execution.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const fullname = &quot;Rakesh Kumar&quot;;
console.log(fullname); // Will print Rakesh Kumar
fullname = &quot;Mahesh&quot;; // TypeError: Assignment to constant variable.</code></pre></div>



<h2 class="wp-block-heading">Arrow function in JavaScript ES6</h2>



<p>It&#8217;s the same as a normal function that we create we create as usual like below let&#8217;s take an example of the addition of two numbers this function will add two provided numbers and return it.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>function add(n1, n2){
	return n1+n2;
}
console.log(add(5,2)); // Will print 7</code></pre></div>



<p>In JavaScript, an arrow function is a shortcut for writing functions. Compared to a conventional function expression, it is syntactically more compact and has several specific features, particularly with regard to this binding. This can be written by using => (&#8220;fat arrow&#8221;) syntax same function converts into an arrow function. There is also no difference in calling.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const add = (a, b) =&gt; {
  return  a + b;
};
console.log(add(5,2)); // Will print 7</code></pre></div>



<p>For more convenience, we can also remove &#8220;{}&#8221; from the function definition. But there is a different calling for single and multiple parameters let see the example for both and single and multiple parameters.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const add = (a, b) =&gt; a + b;
console.log(add(5,2)); // Will print 7

const doubler = x =&gt; 2 * x;
console.log(doubler(5)); // Will print 10

const say = () =&gt; &#39;Say Hello&#39;;
console.log(say()); // Will Say Hello</code></pre></div>



<p><strong>use case for arrow function:</strong><br>This implementation in short inline actions, like array operations (map, filter, reduce)</p>



<h4 class="wp-block-heading">Differences from Regular Functions:</h4>



<p><strong>Lexical </strong><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color has-ast-global-color-7-color">this</mark><strong> Binding:</strong> Arrow functions don&#8217;t have a context of their own. Rather, they inherit this from the global scope or surrounding function. When you wish to maintain the surrounding scope&#8217;s value during callbacks, this is quite helpful.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>function counter() {
  this.increment = 0;
  setInterval(() =&gt; {
    this.increment++; // &#39;this&#39; refers to the counter instance
  }, 1000);
}
let c = new counter();
console.log(c.age); // will print 0</code></pre></div>



<p>In the above example, you can see it will print 0 because of this reference to global scope. If we<br>console.log(this.increment)<br>within the setInterval curly braces inside then will print. So, it&#8217;s globally scoped and block context.</p>



<p><strong>Cannot be used as Constructors:</strong><br>The arrow function can not be used as a constructor you can see in the above example like<br>let c = new counter();<br>But if we can try with same thing with the arrow function will print the below error.<br>TypeError: counter is not a constructor</p>



<p><strong>Implicit return:</strong><br>When creating a single argument function then return the keyword not required by default omitted.<br>const doubler = x => 2 * x;<br>In this example, you can see I have not used the return keyword.</p>



<h4 class="wp-block-heading">Use Cases of arrow function in JavaScript ES6</h4>



<p>The best implementation of the arrow function you can see in map, filter, and reduce.</p>



<h2 class="wp-block-heading">Modules in JavaScript ES6</h2>



<p>JavaScript modules were established through the ES6 module syntax, providing a standardized approach for importing and exporting code across different files. This modularity enables programmers to organize their code more effectively and facilitates the sharing of functionality among various components of an application.</p>



<p>To explain the module let&#8217;s take an example that already stated that modular means we can write code in different files and use any place so let me create three files.<br><code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">user.js // contain user information<br>address.js //will contain details related to address<br>main.js // it's the final file in which call both above file code</mark></code></p>



<h3 class="wp-block-heading">Exporting from a Module</h3>



<h4 class="wp-block-heading"><strong>Default Export</strong>:</h4>



<p>Now I have created first file <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">user.js</mark></code> in which you can see it I have saved the user information in variable user and at the end I have added the line<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-6-color"> </mark><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">export default user</mark><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-ast-global-color-6-color">;</mark></code> this code provides the ability to use method, variable, etc in another file. In default export, we can export only the single class, method, and variable in another file by import.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>// Filename : user.js 
//---------------------------
const user = {
    username:&quot;Jhon&quot;,
    email:&quot;john@gmail.com&quot;
}
export default user;</code></pre></div>



<h4 class="wp-block-heading"><strong>Named Exports</strong>:</h4>



<p>Now move to 2nd file <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">address.js</mark></code> in which handles user address-related information. Also will see the syntax for named export. To define named export we have to write export preceding to function, variable or class so that can be exported and used in another place. Help of named export we can export multiple function variables and classes.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>// Filename : address.js 
//---------------------------
export let getCity = () =&gt;{
    return &quot;Noida&quot;;
}
export let addressId = 25;</code></pre></div>



<h3 class="wp-block-heading">Importing from a Module in JavaScript ES6</h3>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="579" src="https://www.postnidea.com/wp-content/uploads/2024/11/module-in-javascript-es6-1024x579.png" alt="Importing from a Module in JavaScript ES6" class="wp-image-282" srcset="https://www.postnidea.com/wp-content/uploads/2024/11/module-in-javascript-es6-1024x579.png 1024w, https://www.postnidea.com/wp-content/uploads/2024/11/module-in-javascript-es6-300x170.png 300w, https://www.postnidea.com/wp-content/uploads/2024/11/module-in-javascript-es6-768x434.png 768w, https://www.postnidea.com/wp-content/uploads/2024/11/module-in-javascript-es6.png 1302w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Note:</strong><br>For importing modules in html file need to add a type module then the module feature will work and the file call should be from a sever like localhost or any server extensions that are available that can be used like Live server which is compatible with Visual Studio Code if you are using Visual Studio Code.<br><br>So, now we add the main file <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">main.js </mark></code>their code explains further. This file will add the main execution and will use the code that is written in the file <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">user.js</mark></code> and <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">address.js</mark></code>. So, In the HTML file need to add a statement like below</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-html" data-lang="HTML"><code>&lt;script type=&quot;module&quot; src=&quot;main.js&quot; &gt;&lt;/script&gt;</code></pre></div>



<h4 class="wp-block-heading"><strong>Named Imports</strong>:</h4>



<p>you can see below code there is added statement <br><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color"><code>import {getCity, addressId} address from './address.js';</code></mark><br>In which <mark style="background-color:var(--ast-global-color-6)" class="has-inline-color"><code>getCity, addressId</code></mark> are the function and variable and <mark style="background-color:var(--ast-global-color-6)" class="has-inline-color"><code>./address.js</code></mark> path of the file in which function and variable are defined.<br></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>// Filename : main.js 
//---------------------------
import {getCity, addressId} address  from &#39;./address.js&#39;; 
console.log(getCity()); // will print Noida
console.log(addressId); // will print  25</code></pre></div>



<h4 class="wp-block-heading"><strong>Renaming Imports</strong>:</h4>



<p>For code readability or any purpose if need to rename the name of a function, variable, or class name then in the module feature you can do it same thing explored by below code.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>import {addressId as id}  from &#39;./address.js&#39;;
console.log(id) //will print 25</code></pre></div>



<p>Above code, you can see addressId changed as id and print the same.</p>



<h4 class="wp-block-heading"><strong>Import All</strong>:</h4>



<p>In the module import, you can import all function methods and variables in a single variable an object by using using <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">* as</mark></code>  so, that no need to import separately same thing explain by code.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>import * as address  from &#39;./address.js&#39;;
console.log(address.getCity()); // Will print Noida
console.log(address.addressId); // will print id 25</code></pre></div>



<h4 class="wp-block-heading">Default import </h4>



<p>Now let me show how can import the default exported module more and less it works like importing all but there is no need to write <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">* as</mark></code> . </p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>import user  from &#39;./user.js&#39;;
console.log(user.username); // will print Jhon</code></pre></div>



<p>You can also rename in default import.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>import u  from &#39;./user.js&#39;;
console.log(u.username); // will print Jhon</code></pre></div>



<h3 class="wp-block-heading">Benefits of Using Modules</h3>



<ul>
<li><strong>Encapsulation</strong>: Modules make code isolated, you can maintain a global namespace more freely by making block-scoped or module-based code.</li>



<li><strong>Reusability</strong>: The same method and variable can be used anywhere there is no need to define and write code again and again.</li>



<li><strong>Maintainability</strong>: Code becomes more organized and readable so that team members or code reviewers can easily understand the code and easy to maintain future.</li>
</ul>



<h2 class="wp-block-heading">class &amp; object / oops concept in javascript es6</h2>



<p>It is used in approximately all programming languages like PHP, Python, Java, and Javascript. Class-based code has many features like code reusability, readability also helps in memory optimization. It&#8217;s a blueprint for creating objects. This feature of javascript es6 is used by many popular frameworks like React, angular, and nextJs. Class code structure definition and calling are the same in all languages only syntax differences are there. Please check the below example for class.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>class userDetail{
	// Default constructor
	constructor(n){
		this.name = n;
		this.source = &quot;Default&quot;;
	}
	// Individual variable
	user_id = 10;
	// Arrow function
	address = () =&gt; {
		return {city:&quot;Noida&quot;,state:&quot;UP&quot;,country:&quot;India&quot;};
	}
}
let user = new userDetail(&quot;Jhon&quot;); // Set default name by constructor
console.log(user.user_id); // Will print 10
console.log(user.name); // will print Jhon
console.log(user.address().city); // Will print Noida</code></pre></div>



<p>We have defined a constructor which calls when the class is initialized and we can assign variable value. We can do all things in class that we can do in global space like define arrow function and define normal variables.</p>



<h3 class="wp-block-heading">Class Inheritance in javascript es6</h3>



<p>The code that is already defined or written needs to be reused in the context of inheritance. For example in the <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">class userDetail</mark></code> the written method and variable need to be used and write the next code then it&#8217;s possible by Inheritance. The code extended by keyword extends then adds the class name like <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">extends userDetail</mark></code></p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>class cart extends userDetail{

	getProducts(){
		return [&quot;Apple Mobile&quot;,&quot;Boat Headphone&quot;,&quot;Mobile Charger&quot;];
	}
}
let user = new cart(&quot;Jhon&quot;); // Set default name by constructor
console.log(user.user_id);   // Will print 10
console.log(user.name); // will print Jhon
console.log(user.getProducts()[0]); // will print Apple Mobile</code></pre></div>



<p>The variable user_id and name is not defined in the class cart but still print name and user_id because the code of existing <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">class  userDetail</mark></code> added or Inherited in <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">class cart</mark></code></p>



<h2 class="wp-block-heading">Array and object Destructuring in in javascript es6</h2>



<p>Assigning values from array or object to a variable or you can say unpack values from an array and assign them to variables.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const colors = [&#39;red&#39;, &#39;green&#39;, &#39;blue&#39;];
const [first, second, third] = colors;

console.log(first);  // Output: &#39;red&#39;
console.log(second); // Output: &#39;green&#39;
console.log(third);  // Output: &#39;blue&#39;</code></pre></div>



<p>In this, if want skip any variable you can do it by skipping assigned variable like below.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const colors = [&#39;red&#39;, &#39;green&#39;, &#39;blue&#39;];
const [first, second] = colors;
console.log(first);  // Output: &#39;red&#39;
console.log(second); // Output: &#39;green&#39;</code></pre></div>



<h4 class="wp-block-heading">Object Destructuring</h4>



<p>You can assign properties to variables by unpacking them from an object utilizing object destructuring. Unless you provide an alternative name, the variable names must correspond to the property names.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const person = { name: &#39;Alice&#39;, age: 25, city: &#39;New York&#39; };
const { name, age, city } = person;
console.log(name); // Output: &#39;Alice&#39;
console.log(age);  // Output: 25

// You can rename variable in object destructuring 

const person = { name: &#39;Alice&#39;, age: 25 };
const { name: personName, age: personAge } = person;
console.log(personName); // Output: &#39;Alice&#39;
console.log(personAge);  // Output: 25</code></pre></div>



<h2 class="wp-block-heading">spread and rest operator in javascript es6</h2>



<p> Both operators are represented by three dots <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">...</mark></code> with the help of these, we can collect the data and spread the next place and also provide flexibility to collect data for function.</p>



<h3 class="wp-block-heading">Spread Operator</h3>



<p>This operator spreads the value of the addition of value to the next variable it works with both array and object. Let&#8217;s understand by code.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>let carBrand = [&quot;Audi&quot;,&quot;Ferrai&quot;,&quot;Hudai&quot;];
let autoBrand = [...carBrand, &quot;Tata&quot;, &quot;Nissan&quot;];
console.log(autoBrand); // will print [ &#39;Audi&#39;, &#39;Ferrai&#39;, &#39;Hudai&#39;, &#39;Tata&#39;, &#39;Nissan&#39; ]

let postAutoBrand = [&quot;Tata&quot;, &quot;Nissan&quot;, ...carBrand];
console.log(postAutoBrand); // will print [ &#39;Tata&#39;, &#39;Nissan&#39;, &#39;Audi&#39;, &#39;Ferrai&#39;, &#39;Hudai&#39; ]</code></pre></div>



<p>In the above code, we have defined three brands in variable <code>carBrand</code>. Now these three values spread in variable autoBrand by using <mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">…</mark> and with the use of spread, you can add values at the start and end of indexing.</p>



<h3 class="wp-block-heading">Rest operator</h3>



<p>It also works the same as the rest operator spread operator works for copy values but the rest operator works for the collection of multiple values or data.<br><strong>Use Case </strong>: <br>Suppose a function needs to pass a dynamic parameter like below.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>function userList(user1, user2, user3){
    return [user1,user2, user3];
}
console.log(userList(&quot;Jhon&quot;, &quot;Ram&quot;, &quot;Nick&quot;)); // [ &#39;Jhon&#39;, &#39;Ram&#39;, &#39;Nick&#39; ]
console.log(userList(&quot;Jhon&quot;)); // [ &#39;Jhon&#39;, undefined, undefined ]</code></pre></div>



<p>You can see that when we did not pass all three parameters in the second call. Then it added undefined on places 2nd and 3rd. So, to fix this issue we have to use the rest operator which collects values in an array format</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>function userList(...users){
    return users;
}
console.log(userList(&quot;Jhon&quot;, &quot;Ram&quot;, &quot;Nick&quot;)); // [ &#39;Jhon&#39;, &#39;Ram&#39;, &#39;Nick&#39; ]
console.log(userList(&quot;Jhon&quot;)); //[ &#39;Jhon&#39; ]</code></pre></div>



<p>Now you can see there is no undefined error the values which you defined will collect it if not then no undefined.</p>



<h4 class="wp-block-heading">Destructuring with Rest Operator</h4>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const fruits = [&#39;apple&#39;, &#39;banana&#39;, &#39;cherry&#39;, &#39;date&#39;];
const [first, second, ...rest] = fruits;

console.log(first);  // Output: &#39;apple&#39;
console.log(second); // Output: &#39;banana&#39;
console.log(rest);   // Output: [&#39;cherry&#39;, &#39;date&#39;]</code></pre></div>



<h2 class="wp-block-heading">Refrence &amp; premitive type variable assigning</h2>



<p>In Primitive type data types (number, string, Symbol, bigint) these are immutable means in this variable the values are directly copied.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>let x = 10;
let y = x; // y is now a copy of x&#39;s value
y = 20;    // changing y does not affect x

console.log(x); // 10
console.log(y); // 20</code></pre></div>



<p>The reference type data type (array &amp; object) not directly values are copied during variable assign there is referencing the pointer that is in memory it will more clearer from the below example.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>let username = { name:&quot;Rakesh Kumar&quot; }
let username2 = username;
console.log(username);// Will print { name: &#39;Rakesh Kumar&#39; }
console.log(username2); // Will print { name: &#39;Rakesh Kumar&#39; }
username2.name=&quot;Jhon&quot;;
console.log(username);// Will print { name: &#39;Jhon&#39; } but expected Rakesh Kumar
console.log(username2); // Will print { name: &#39;Jhon&#39; }</code></pre></div>



<p>In the above example the variable contains the <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">name</mark></code> &#8220;Rakesh Kumar&#8221; Before manipulating the variable <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">username2</mark></code> was print <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">{ name: 'Rakesh Kumar' }</mark></code> but after changing the value in<code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color"> username2.name</mark></code> both are print<code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color"> { name: 'Jhon' }</mark></code> but we changed in <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">username2</mark></code> and username change itself. It happens because both are references to the same location. There is no direct copy of the values.</p>



<p>Now how can we fix this issue so that we can copy the values of one object to another and the original object should be the same or not any modification there? For this, we can use a<strong> spread operator</strong>.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>let username = { name:&quot;Rakesh Kumar&quot; };
let username2 = {...username};
console.log(username);// Will print { name: &#39;Rakesh Kumar&#39; }
console.log(username2); // Will print { name: &#39;Rakesh Kumar&#39; }
username2.name=&quot;Jhon&quot;;
console.log(username);// Will print { name: &#39;Rakesh Kumar&#39; }
console.log(username2); // Will print { name: &#39;Jhon&#39; }</code></pre></div>



<h2 class="wp-block-heading">Array map and array filter in javascript es6</h2>



<h3 class="wp-block-heading">Array Map:</h3>



<p>By giving each element of an existing array a function, the <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">map()</mark></code> method generates a new array. Every element receives a new value from this method, which <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">map()</mark></code> then aggregates into the new array. The original array and its values remain unchanged.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const numbers = [1, 2, 3, 4];
const multiplier = numbers.map(num =&gt; num * 2);
console.log(multiplier); // [2, 4, 6, 8]
console.log(numbers); // [1, 2, 3, 4] (original values unchanged)</code></pre></div>



<h3 class="wp-block-heading">Array filter</h3>



<p>The name filter clearly states that the <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">filter() </mark></code>used for filter the values of the array on the certain business logic or conditions. In this also original array and its values are not changed it creates a new array on the condition <code><mark style="background-color:var(--ast-global-color-6)" class="has-inline-color">true</mark></code>.</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-js" data-lang="JavaScript"><code>const numbers = [1, 2, 3, 4, 5];
const evenNumbers = numbers.filter(num =&gt; num % 2 === 0);
console.log(evenNumbers); // [2, 4]
console.log(numbers);      // [1, 2, 3, 4, 5] (original array remains unchanged)
</code></pre></div>



<h2 class="wp-block-heading">Conclusion</h2>



<p>The complete post is written in keep min in javascript es6. It is a brief discussion about es6 concepts so that you can understand the latest framework and libraries like react, angular, Vue, and react. These front-end technologies are most popular those days but they all use modern javascript concepts. So, I hope you will enjoy the post and try to start learning new frameworks or libraries. Thanks for reading the article.</p>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/a-refreshing-dive-into-javascript-es6-concepts/">A Refreshing Dive into JavaScript ES6 Concepts</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Top 10 WordPress plugin make development faster</title>
		<link>https://www.postnidea.com/top-10-wordpress-plugin-make-development-faster/</link>
					<comments>https://www.postnidea.com/top-10-wordpress-plugin-make-development-faster/#respond</comments>
		
		<dc:creator><![CDATA[Rakesh Kumar]]></dc:creator>
		<pubDate>Sun, 25 Mar 2018 17:21:00 +0000</pubDate>
				<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[woocommerce]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[Ecommerce]]></category>
		<category><![CDATA[Plugin development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://www.postnidea.com/top-10-wordpress-plugin-make-development-faster/</guid>

					<description><![CDATA[<p>Most of time designer &#38; developer both are working on the WordPress projects. But if the designer has a little [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/top-10-wordpress-plugin-make-development-faster/">Top 10 WordPress plugin make development faster</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;">
<p>Most of time designer &amp; developer both are working on the WordPress projects. But if the designer has a little bit knowledge of PHP &amp; WordPress basics then he can also complete project itself. In that case, an organization can save the developer efforts &amp; the saved efforts can utilize on urgent tasks. Now today I have shown you few WordPress plugins can make your WordPress development faster.</p>
<p>Few important things need to do to start WordPress project.<br />
&#8211; When you start WordPress installation then always use a unique prefix for the WordPress database table.<br />
&#8211; Always set our custom keys<br />
&#8211; Whenever you customize MySQL query then always use $wpdb-&gt;prefix.</p>
<h2>1. Visual Composer</h2>
<p>It&#8217;s paid plugin but it has most important features. A normal user can also design our website without the need of a designer. It&#8217;s already have so many shortcodes like the post, taxonomy, slider, apply CSS properties. There is a problem it saves page content in the database. So there is need to make changes very care full. Always need to enable page revision.</p>
<p><a href="https://visualcomposer.io/" target="_blank" rel="noopener noreferrer"> More Info </a></p>
<h2>2. contact form 7 or gravity form</h2>
<p>Forms are common parts of the web application. Contact form 7 &amp; gravity form are two plugins that will helps the user in creating form. Contact Form 7 is a popular free plugin most of WordPress website use contact form 7. Gravity form has extra features due to these features it&#8217;s paid. In Both form plugin, you can integrate our custom HTML<br />
<a href="https://wordpress.org/plugins/contact-form-7/" target="_blank" rel="noopener noreferrer"> More Info </a><a href="https://www.gravityforms.com/" target="_blank" rel="noopener noreferrer"> More Info </a></p>
<h2>3. woocommerce</h2>
<p>E-commerce &amp; blog a normal requirement of client every client. WordPress already have blog functionality. But not have e-commerce functionality. So, for implement e-commerce, there is need to add another plugin. So, woocommerce is a plugin that enables e-commerce functionality. It&#8217;s very old plugin so it has a huge amount of support.</p>
<p><a href="https://wordpress.org/plugins/woocommerce/" target="_blank" rel="noopener noreferrer"> More Info </a></p>
<h2>4. Yoast SEO</h2>
<p>Once the website is complete then marketing of a website is very important. If the website can&#8217;t generate the revenue and customer then it&#8217;s not beneficial. For search engine optimization purpose on page optimization very important. It will help in SEO. Yoast SEO plugin which enables the SEO features on your WordPress project.</p>
<p><a href="https://wordpress.org/plugins/wordpress-seo/" target="_blank" rel="noopener noreferrer"> More Info </a></p>
<h2>5. Custom Post Type Maker<br />
<b></b></h2>
<p>When you start the custom application in WordPress then always a requirement of a custom post like a portfolio, team, etc. So &#8220;Custom Post Type Maker&#8221; plugin which helps to create custom post type &amp; taxonomy.</p>
<h2><a href="https://wordpress.org/plugins/custom-post-type-ui/" target="_blank" rel="noopener noreferrer"> More Info</a> <a href="https://wordpress.org/plugins/wck-custom-fields-and-custom-post-types-creator" target="_blank" rel="noopener noreferrer">More Info</a><br />
<b><br />
</b>6. advanced custom field</h2>
<p>It&#8217;s the plugin which extends you custom post functionality. With the help of them, you can create the meta fields, repeater fields. It provides an easy interface so that non-developer user can also extend the project functionality.<br />
<a href="https://wordpress.org/plugins/advanced-custom-fields/" target="_blank" rel="noopener noreferrer"> More Info </a></p>
<h2>7. Fast cache</h2>
<p>It will help in the performance of your WordPress project. It enables cache on your project so that most of the pages serve for the customer from the cache so, that your server or hosting resource become save. In short, you can get great performance with short of resources. If you can afford paid version then you can get the CDN &amp; database optimization &amp; cache features.</p>
<p><a href="https://wordpress.org/plugins/wp-fastest-cache/" target="_blank" rel="noopener noreferrer"> More Info</a></p>
<h2>8. wp security</h2>
<p>Once your website is ready &amp; running in live mode or real world then security is very important. If your website down for a day then it&#8217;s a retarded lot of revenue even left bad impressions on the visitors. wp security plugin which provides the various types of security like file security, database security, login lockdown session exploiting &amp; many more.</p>
<h2><a href="https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/" target="_blank" rel="noopener noreferrer"> More Info</a><br />
<b><br />
</b>9. migrate DB</h2>
<p>It&#8217;s common plugin used by most of the developer&#8217;s because when you try to replicate current working website on our local then it provides you database according to your local URL. Mainly it helps in replacement of the URLs. So that you set up website locally faster.</p>
<p><a href="https://wordpress.org/plugins/wp-migrate-db/" target="_blank" rel="noopener noreferrer"> More Info</a></p>
<h2>10. qTranslate X or WPML</h2>
<p>If your website is multi-language then above both plugin great helps in translating. You can provide the translation for each language so that it will show the translated string for your user according to their locality.</p>
<p><a href="https://wordpress.org/plugins/qtranslate-x/" target="_blank" rel="noopener noreferrer"> More Info</a></p>
<h2>11. BuddyPress</h2>
<p>It helps to create networking website. Its provide a great feature of social networking website like activity, share, groups, pages &amp; create connections between each other. You can also extend their functionality by overriding theme or plugin.</p>
<p><a href="https://wordpress.org/plugins/buddypress/" target="_blank" rel="noopener noreferrer"> More Info</a></p>
<div style="clear: both; text-align: center;"></div>
</div>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/top-10-wordpress-plugin-make-development-faster/">Top 10 WordPress plugin make development faster</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.postnidea.com/top-10-wordpress-plugin-make-development-faster/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Product documentation : with use of wordpress contextual help</title>
		<link>https://www.postnidea.com/product-documentation-with-use-of-wordpress-contextual-help/</link>
					<comments>https://www.postnidea.com/product-documentation-with-use-of-wordpress-contextual-help/#respond</comments>
		
		<dc:creator><![CDATA[Rakesh Kumar]]></dc:creator>
		<pubDate>Sun, 12 Feb 2017 16:51:00 +0000</pubDate>
				<category><![CDATA[Branding]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[product documentation]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress contextual help]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[Plugin development]]></category>
		<category><![CDATA[WordPress contextual help]]></category>
		<guid isPermaLink="false"></guid>

					<description><![CDATA[<p>For any product, document ion is very important. When you develop a product then only you know how its work [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/product-documentation-with-use-of-wordpress-contextual-help/">Product documentation : with use of wordpress contextual help</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;">
<p>For any product, document ion is very important. When you develop a product then only you know how its work &amp; how to use. But if someone new person tries to use then he can&#8217;t use it so, in that case, your product useless for the user. So whenever you develop any product there is need to create a proper documentation. The documentation should cover below points.</p>
<h2>About product</h2>
<p>In this section describe our product completely like &#8220;about product&#8221;, &#8220;Why you made it&#8221;. If you develop something new product then there is no need to a comparison. If some product already exists then there is a need for comparison so that user can compare it. If a user uses an already product and your product have something new and better than user remve/uninstall our product &amp; try your, In that situation, if your product works better than user always use your product if he fails then he use our existing product. So there more important to include about a product, advantage, disadvantage last but not least comparison.</p>
<h2>How to use it</h2>
<p>It&#8217;s very important section so it&#8217;s documented very carefully. There is need to clarify more clearly so that user can easily understand. There is a need for more graphics &amp; text so that user have a clear idea. If your product is digital then nowadays different platforms like youtube, SlideShare, GitHub can help you. This platform provide you an area in which you show graphics, picture &amp; animation so that product user can easily understand &amp; use it.</p>
<h2>Reviews</h2>
<p>In this section provide the way (review submit form, toll-free number, or any number) through which user can provide the reviews. With the help of reviews, you can improve your product. Because mistakes make perfect so it&#8217;s more important.</p>
<p>I review many plugins of WordPress the author writes very good &amp; usable plugins but they fail only the documentation. Now WordPress provide a help section on top of the screen so take help of that you can provide help text &amp; animation on each page.</p>
<p>start with creating simple, so I write code for creating a plugin which is below</p>
<p>Now the plugin is created but only its shows in the plugin list now there is a need to links on sidebar menu so that user can move on the pages by clicking on that. Now below code add two menus in admin sidebar menu. The below menu also connected with function my_magic_function &amp; my_magic_function1.</p>
<p>Now Menu appears in the sidebar now on click on menu need to redirect on the page now I write a below code which creates the page on which user can redirect.</p>
<p>Now everything gone fine now the small plugin is ready but there is scanty of documentation now below code add the help text in above screen.</p>
<p>Now when you install this plugin in our wordpress set up then you can see the demo. I also attached the youtube video on which you also see the demo.</p>
<p><iframe src="https://www.youtube.com/embed/XFqWsHGMmJg?rel=0&amp;showinfo=0" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p>You can also browse the complete code by click on next button<br />
<a class="btn btn-primary btn-blue" href="https://github.com/postnidea/wordpress-Contextual-Help" target="_blank" rel="noopener noreferrer">code</a></p>
</div>
<p>The post <a rel="nofollow" href="https://www.postnidea.com/product-documentation-with-use-of-wordpress-contextual-help/">Product documentation : with use of wordpress contextual help</a> appeared first on <a rel="nofollow" href="https://www.postnidea.com">Postnidea</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.postnidea.com/product-documentation-with-use-of-wordpress-contextual-help/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
