Great Techniques to Self Mastery

| Comments

I finished reading a book named “A Monk Who Sold His Ferrari” by Robin S. Sharma, It was a great self-help book I ever read after Eat that frog. This post highlights the key elements covered in the book

Follow below 7 techniques to self-mastery your destiny(Nirvana). Life is all about choices, One’s destiny unfolds according to the choices one makes

Master your mind

Mind comes first and foremost important aspect to any self-improvement. Nourish your mind with positive thoughts and keep your mind healthy. When you form the habit of searching for the positive in every circumstance, your life will move to its highest dimensions. This is one of the greatest of all the natural laws. Remember, either you control your mind or it controls you

Imagination is more important than knowledge - Einstein

Follow your purpose

Once you have a clear mindset define goals, without goals you will just drift. So write your goals read it every day. The human mind is the world’s largest filtering device. When used properly it filters out what you perceive as unimportant and gives you only the information you are looking for at that time. When you decide to start concentrating your mind on your life’s main aims your mind starts to filter out the unimportant and focus only on the important.

I am an artist at living — my work of art is my life. - Suzuki

Practice Kaizen

Kaizen is a Japanese technique to constantly improve oneself. Keep improving yourself and never stop learning. You do not have the time to improve yourself, whether this mean improving your mind or nourishing your spirit, is much like saying you do not have time to stop for gas because you are too busy driving. Self-mastery is the DNA of life mastery.

Good people strengthen themselves ceaselessly — Confucius

Live with Discipline

Willpower is like a muscle, the more you use the stronger it becomes. Don’t fall for time wasting / non-important work / bad habits. Wage war against the weaker thoughts that have crept into the palace of your mind. They will see that they are unwanted and leave like unwelcome visitors. Stick with good habits and live a great disciplined life.

Discipline is the bridge between goals and accomplishment — Jim Rohn

Respect your time

Time is non-renewable resource, once lost is lost forever. So utilize time wisely. Great leaders/legends seek learning over entertainment. Have some entertainment don’t let it eat the most valuable resource (time). Those who use time wisely from an early age are rewarded with rich, productive and satisfying lives. Those who never been exposed to the principle that ‘time mastery is life mastery’ will never realize their enormous human potential. Time is the great leveler.

Well arranged time is the surest mark of a well-arranged mind. — Sir Isaac Pitman

Selflessly serve others

The quality of your life ultimately comes down to the quality of your contribution. To cultivate the sacredness of each day, live to give. By elevating the lives of others, your life reaches it’s highest dimensions. Practice daily act of kindness.

The sole meaning of life is to serve humanity — Leo Tolstoy

Embrace the present

Happiness is a journey, not a destination. Practice gratitude and be thankful for what you have. Enjoy the tiny little beauty around you and live in the “now” moment to the fullest.

When I admire the wonder of a sunset or the beauty of the moon, my soul expands in worship of the creator — Mahatma Gandhi

Small victories lead to large victories, Tiny, incremental changes, and improvements such as those I have suggested will create positive habits. Positive habits will create results. And results will inspire you towards greater personal change. Begin to live each day as if it was your last. Starting today, learn more, laugh more and do what you truly love to do. Do not be denied your destiny.

“You sow a thought, you reap an action. Reap an action, you sow a habit. Sow a habit, you reap a character. Sow a character, you reap your destiny.”

How to Avoid Array Duplicates in Javascript

| Comments

JavaScript arrays is of great help(as they are in any language), but if you want to avoid duplicates in arrays then you need to multiple steps. That’s why ES6 introduced sets, a new type of collection that cannot contain duplicates.

You can create a set in ES6 by passing an array into the constructor:

let set = new Set([1, 2, 3, 3, 4, 5, 5, 5, 6]);

console.log(set.size); // 6

Notice the array I passed in contains duplicates. But the set essentially strips them out and I’m left with a collection of 6 unique items (instead of the original 9 with duplicates), which is much more useful in certain situations.

You don’t have to pass in an array to create a set, but that’s one way to do it. You also have access to the add() method, so you can do this:  

let set = new Set();


console.log(set.size); // 2

Finally, there’s the has() method, which is probably what you’ll use the most. This method allows you to check if an item exists. And because sets can’t contain duplicates, it’s a simple check, then you can move on to other things without any complexities:

console.log(set.has(1)); // true
console.log(set.has('two')); // true
console.log(set.has(3)); // false

The feature has strong browser support, so goahead and use this in your project.

Credits: MDN, WebWeekly Newsletter