Javascript Object.is - An alternative to equality operators in JavaScript JavaScript is a loosely typed language and in some cases it fall behind specially when it comes to equality comparision. There are two operators to compare equality in JavaScript, double equal operator ==
Life A simple guide to creating habits for a great year A new year is here and with that our eagerness to make positive changes in our life too. The best way to do that is not making resolutions, but creating habits that will
Angular Create two-way data binding in Angular You must have used [(ngModel)] and its world-famous “banana in a box” syntax while working with Angular 2 and greater. Unlike AngularJS, Angular does not provide two way binding by default, which avoids
Javascript Battle between Slice and Splice in JavaScript Every once in a while one needs to play with part of an array and almost always end up looking for the difference between slice() and splice() first. Let’s clear the confustion between
Angular A Cleaner Way To Bind Specific Keys to Keyup and Keydown Events in Angular Binding keyup or keydown events in Angular is pretty straight forward. <input type="textbox" (keydown)="onKeydown($event)"> onKeydown($event){ console.log($event.key); // This will log key which is pressed. } But most of the time we need to
Angular Using Event Emitters in Angular Every once in a while you need a child to communicate with its parent, that is when Angular Event Emitter comes handy. In Angular, data flows into the component via property bindings and
Angular Creating custom Angular pipes Pipes in Angular 2+ (Filters in Angular 1) are a great way to transform and format data right from your templates. Out of the box you get pipes for dates, currency, percentage and
Angular Using SCSS/SASS/LESS to style your Angular project Admit it, we all love scss/sass/less because of its capabilities and wants to use it in all of our projects. However while working with Angular CLI, the default stylesheet have the .css extension.
Javascript Detecting Array vs Object in JavaScript The behaviour of JavaScript can be tricky some times. Consider the example below. const getListOfPlayerNames = players => { if(players instanceof Object){ return [players.name]; } else if(players instanceof Array){ return player.map(player => {
Javascript Default parameters in JavaScript Remember we had to do these statements short circuit statements to define default parameter? function area(l, w) { var length = l; var width = w || 10; return length*width; } That is
Tips Adding Google Drive to Windows Explorer's Sidebar I recently started using Google Drive to store my stuffs. Just installed it on my windows machine and to my wonder, Google Drive folder shortcut doesn’t exists in Windows Explorer Sidebar as OneDrive
Design I am sick of tiny typography Your tiny type is hard to read - no, not hard to read, impossible to read. I don’t know why people still set 12px as body font-size. Your users are not here to
Javascript Fast (and slow) way to append elements in DOM JQuery is a no doubt powerful tool for front-end developers because of the way it makes the task of handling DOM easier, but it does not alleviate the responsibility of ensuring that your
Tips Having a strong password does not protect you from vulnerabilities relating to password reuse So you’ve come up with a strong password that you use to sign up to most internet services you use. Great! You are now probably safe from people who are trying to log
Javascript Short-circuit evaluation in JavaScript Short-circuit or Minimal or McCarthy evaulation says, the second argument is executed or evaluated only if the first argument does not suffice to determine the value of the expression, when the first argument
Javascript Detect if document is ready in pure JavaScript While JavaScript does provide the load event for executing code when a page is rendered, this event does not get triggered until all assets such as images have been completely received. In most
Javascript Parameter passing in JavaScript In JavaScript, we have functions and arguments that we pass into those functions. But how JavaScript handles what you are passing is little tricky. Technically JavaScript only passes by value for both primitives
Design Design for Fingers and Thumbs In a dart, hitting the bulls-eye is harder to do than hitting any other part of the board. This is because of small hit area of bulls-eye. The same principle can also be