Posts
-
Use button if you mean it
Use
<button>if you want it to behave as a button. If you are using any otherHTML elementand updating its look, to look likebutton, you are either bothering your users or yourself. -
I will never use || (OR) for default values
TL;DR;
I will never use
||for default values, but default parameter.For example, instead of
function sort(array, startIndex, endIndex) { startIndex = startIndex || 0; endIndex = endIndex || array.length — 1; ... }I would use,
function sort(array, startIndex = 0, endIndex = array.length - 1) { ... } -
No sound for audio when iPhone connected over Bluethooth
All of a sudden, there was no Bluetooth audio in my car (Corolla 2016), when paired with my iPhone. It has been working fine, so far. As usual, I did not RTFM. Not sure, if that would have helped. I could have leaved with out the music but it was difficult to follow Google Map’s navigation instruction. Yes, I use Google Maps instead of the default. I had to keep looking at the phone, quite a often.
-
Do you know this?
The value of
thisin ECMAScript refers to the execution context of the function. In ECMAScript there are three execution context; namely global, function and evaluation. Following example will help to comprehend the concept better. -
Inheritance in JavaScript
Let’s consider that
squareis a special type ofrectangle, whoselengthandwidthare equal. Thus we can createblueprintof asquareby extending theblueprintof arectangle. I am using the termblueprintas JavaScript/ECMAScript version prior ES2015 did not haveclassfunctionality.