Category Archives: javascript

G spot for Regex

Everyone uses regular expressions. Sometimes they are just the simplest way to check or extract something from the text. Regular expressions in JS can be modified with flags. Two are simple: ‘i’ stands for ‘case insensitive’, ‘m’ for ‘multiline’. There … Continue reading

Posted in javascript | Tagged | 1 Comment

Poor Man’s Immutable

In ReactJS, the main idea is having a virtual DOM, that is only reconciled with actual DOM when need be. In addition to that, there’s a shouldComponentUpdate() method, that is called before re-rendering a component and allows the developer to … Continue reading

Posted in javascript | Tagged , , | Leave a comment

Scroll and wheel

This is a truth universally acknowledged that one event handler is better than ten. Usually, events bubble. That is, they are passed on to “upper” – parent – element levels, and higher and higher and higher. So, if you have, … Continue reading

Posted in javascript | Tagged , | Leave a comment

Breaking point

This will be a very short post about a thing that is only useful sometimes, but then when it is useful, it can be very much so. This is how to set a breakpoint programmatically, in your browser, for debugging … Continue reading

Posted in javascript | Tagged | Leave a comment

Click and Mouse Down

Recently I have introduced a JavaScript bug into one of our components while trying to fix another one. With the fix, I added an onBlur event to the input component; and somehow it stopped another event handler, namely an onClick, … Continue reading

Posted in javascript | Tagged , , | Leave a comment