7 common mistakes by newbie bloggers

Choosing the domain

Choosing the wrong domain name or free domain. Picking the right domain name based on niche will help Visitors to remember easily & relate with content.

Mixing up niche

Don’t mix up the blog topics too much. Decide your niche clearly. If your blog is focused on programming, food or lifestyle. Mixing up niche will discourage recurring visitors. If you really want to cover multiple niche – maintain proper category.

Write consistently

Consistency is the key. Make proper plan, write and schedule the Content. If you can write one post in a week or two week. Just go with it and schedule post accordingly. One of my favorite blogger posts Content on every Tuesday and Friday.

Copying content without giving credits

If you are referring and copying a part of sentence from another site. Give proper credits in your post. And also never copy paste entire content. Respect others work.

Never to hesitate to write small post

Never hesitate to write “How To” kind of post. If it solves a rare problem, even if it is a small post. It will get more traction. Even my blog have such kind of posts which gains me more traffic and tops at Google search.

Avoid grammatical mistakes

N number of online free tools available to check the spelling mistakes and grammatical mistakes. I myself did these kind of mistakes at start of my blogging journey. Sometimes my friends read it and message me to correct it.

Have your own style of writing

Prepare your own way of presentation. Design your own content delivery technique and the social media sharing schedules.

Happy blogging!

Credits

Photo by Andrew Neel on Unsplash

Photo by Markus Winkler on Unsplash

Photo by Bench Accounting on Unsplash

Photo by NeONBRAND on Unsplash

Photo by Daniela Holzer on Unsplash

What’s new in ECMAScript 2016 / ES 7

Since ES6 has released, we have discussed the interesting features in our site earlier in the ECMAScript 6 tag. ES 6 release contains lots beautiful features like arrow functions, template literals, destructuring, default parameters, etc.

Now, its time experiment and explore es-next – ECMAScript 2016 / ES7 🙂

I shall make a separate post on this name convention of the release later. Now let’s stick with discussion of features.

Ecma Technical Committee 39 governs the ECMA specification. They follow certain stages to handle the proposals, starts from stage 0 to stage 4. The proposals which reached the stage 4 are the finished proposals. ES7 included support for a new exponentiation operator and adds a new method to Array.prototype called includes.

Let’s discuss the following two features in this post:

  1. Array.prototype.includes
  2. Exponentiation operator

 

Array.prototype.includes

The formal syntax of includes is

Array.prototype.includes ( searchElement [ , fromIndex ] )

where fromIndex is optional.

includes compare searchElement to the elements of the array, in ascending order, using the SameValueZero algorithm, and if found at any position, returns true; otherwise, false is returned.

The optional second argument fromIndex defaults to 0 (i.e. the whole array is searched). If it is greater than or equal to the length of the array, false is returned, i.e. the array will not be searched. If it is negative, it is used as the offset from the end of the array to compute fromIndex. If the computed index is less than 0, the whole array will be searched.

// ES 7
var fruits = ['mango', 'jack fruit', 'banana' ]
fruits.includes('mango') // true
fruits.includes('orange') // false
// Earlier
var fruits = ['mango', 'jack fruit', 'banana' ]
fruits.indexOf('banana') // returns 2 – index of the array
fruits.indexOf('orange') // return -1 means value is not available in array

view raw
ES_7_includes.js
hosted with ❤ by GitHub

Earlier, I have used indexOf to check whether the particular element is present in the array or not. Now, using includes we can directly validate the same in conditional loops.

The includes function is intentionally generic; it does not require that its this value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method.

The includes method intentionally differs from the similar indexOf method in two ways. First, it uses the SameValueZero algorithm, instead of Strict Equality Comparison, allowing it to detect NaN array elements. Second, it does not skip missing array elements, instead of treating them as undefined.

Examples:

assert([1, 2, 3].includes(2) === true);
assert([1, 2, 3].includes(4) === false);

assert([1, 2, NaN].includes(NaN) === true);

assert([1, 2, -0].includes(+0) === true);
assert([1, 2, +0].includes(-0) === true);

assert(["a", "b", "c"].includes("a") === true);
assert(["a", "b", "c"].includes("a", 1) === false);

 

Exponentiation operator

ECMAScript 2016 introduced the exponentiation operator, **.

We already have the operator of addition +, subtraction -, multiplication *, division /. Now its time to experiment the exponentiation operator **.

It operates similarly to Math.pow()

// Math.pow (x, y)
Math.pow(2,3) // 8
2 ** 3
// 8
// where first digit is base and second digit is exponent
var square = 5 ** 2;
console.log(square) // 25
var cube = 5 ** 3;
console.log(cube) // 125

 

Experiment the above new features, and let me know your feedback on the comment section.

Happy Coding!