hello.js

var please = require('share');
console.log('thank you');

NEW !!!

Sunday, 12 August, 2018 UTC

Using style.setProperty() To Keep CSS Property Names Consistent In JavaScript

Ben Nadel showcases the style.setProperty() method in JavaScript. This allows you to update CSS styles; but, unlike mutating the style object directly, the .setProperty() method allows you to keep your CSS names consistent in both CSS and JavaScript.... ... more


Thursday, 2 August, 2018 UTC

Checking To See If An Element Has A CSS Pseudo-Class In JavaScript

Ben Nadel demonstrates how to use the Element.matches() method in JavaScript to see if a given element has a CSS pseudo-class being applied to it. This covers pseudo-classes like ":hover" and ":active" as well as things like, ":-webkit-autofill".... ... more


Friday, 27 July, 2018 UTC

Implementing A "Show Password" Checkbox On A Login Form In JavaScript

Ben Nadel demonstrates how to implement a "show password" checkbox on a login form using JavaScript. This allows the user to change the password field from an obfuscated input to a plain-text input in order to make it easier to see what password ... more


Monday, 23 July, 2018 UTC

Downloading Text Using Blobs, URL.createObjectURL(), And The Anchor Download Attribute In JavaScript

Ben Nadel looks at prompting text downloads by converting plain-text values into Blobs, creating Blob URIs with the URL.createObjectURL() method, and then attaching said Blob URIs to anchor tags with "download" attributes.... ... more


Tuesday, 10 July, 2018 UTC

Timezone In Date .toTimeString() Is Not Always An Abbreviation In JavaScript

Ben Nadel demonstrates that the timezone portion of the Date .toTimeString() method in JavaScript is not always represented as an abbreviation. Therefore, if you're parsing the time string to extract the timezone, you may have to use a more flexible ... more


Friday, 15 June, 2018 UTC

Automatically Scroll The Window When The User Approaches The Viewport Edge In JavaScript

Ben Nadel looks at how to automatically scroll the browser window when the user's mouse approaches the edge of the viewport in JavaScript. This is primarily a note-to-self; but, it may serve as help for others.... ... more


Friday, 8 June, 2018 UTC

Enable Tabbing Within A Fenced Code-Block Inside A Markdown Textarea In JavaScript

Ben Nadel considers the use of markdown in his comments; and, how he can greatly increase the usability of the commenting textarea by enabling tabbing features (Tab, Shift+Tab, Enter, Shift+Enter) while the user is editing a fenced code-block.... ... more


Tuesday, 5 June, 2018 UTC

Randomly Selecting RegEx Day Winners Using A Cryptographically Secure Pseudo-Random Number Generator (CSPRNG) In Node.js

Ben Nadel uses a cryptographically secure pseudo-random number generator (CSPRNG) in Node.js to randomly select the winners of the 2018 RegEx Day celebrations.... ... more


Tuesday, 5 June, 2018 UTC

Exploring Plain-Text Data URIs And The Anchor Download Attribute In JavaScript

Ben Nadel discovers that Data URI payloads do not have to be Base64-encoded when dealing with plain-text content. And, that this feature can provide a very easy way to prompt custom file downloads in JavaScript, using the anchor "download" ... more


Saturday, 2 June, 2018 UTC

jQuery's append() Methods Intercept Script Tag Insertion And Circumvent Load Handlers

Ben Nadel digs into the jQuery source and discovers that the various "append" methods intercept Script Tags and load the requested SRC locations using AJAX. This bypasses any "onload" event handlers; and, fails silently in the jQuery ... more


Wednesday, 23 May, 2018 UTC

Environment Variables Represent Global State And Should Be Accessed By The Application Bootstrapping Logic Only

Ben Nadel considers the haphazard use of Environment Variables in Node.js applications (or any application for that matter). He equates them to "global state"; and reflects on why using them incurs a host of problems with regard to the long-term ... more


Tuesday, 22 May, 2018 UTC

Binding RxJS Observable Sources Outside Of The NgZone In Angular 6.0.2

Ben Nadel looks are RxJS in the context of Zone.js and Angular's change-detection algorithm. And, explores the patch files that Zone.js provides for making 3rd-party libraries, like RxJS, zone-aware.... ... more


Saturday, 19 May, 2018 UTC

Functional-Light JavaScript By Kyle Simpson

Ben Nadel reviews Functional-Light JavaScript by Kyle Simpson. Kyle has an effortless writing style and a knack for breaking down complex concepts into bite-sized pieces which he can then use to construct an increasingly-sophisticated and multi-faceted ... more


Saturday, 5 May, 2018 UTC

The Angular Framework Forces You To Learn More JavaScript, Making You A Better JavaScript Programmer

Ben Nadel explains why choosing Angular as your application framework will turn you into a ninja rockstar unicorn 10x JavaScript developer! Not only will Angular force you to learn more JavaScript; but, the underlying Dependency-Injection system will ... more


Thursday, 3 May, 2018 UTC

Sanity Check: Manipulating Event Handlers And Timers Outside Of NgZone In Angular 5.2.10

Ben Nadel performs a sanity-check exploration of Zone.js bindings in Angular 5.2.10, confirming that handlers bound within handlers that were, themselves, bound outside of the Angular Zone will all use the same zone instance and bypass Angular's change-detection ... more


Monday, 2 April, 2018 UTC

Tracking Image Error Events Using Event Delegation In JavaScript

Ben Nadel talks about the three phases of Event handling on the DOM (Document Object Model); and, how we can track IMG Error events using Event Delegation if we observe the Capture phase, not the Bubble phase.... ... more


Thursday, 15 March, 2018 UTC

From Noob To Docker On DigitalOcean With Nginx, Node.js, DataDog Logs, DogStatsD, And LetsEncrypt SSL Certificates

Ben Nadel takes his first independent foray into Docker, creating a simple "hello world" site using Docker, node.js, nginx, DataDog, DogStatsD, and LetsEncrypt for SSL certificates, all deployed on DigitalOcean using Docker Hub as an image ... more


Thursday, 1 February, 2018 UTC

In Node.js, The error.stack Property Will Represent The Point In The Code At Which new Error() Was Called - Not When The Error Is Thrown

Ben Nadel demonstrates that stack-traces (error.stack) in Node.js point to the line of code on which the Error() object was created - not to the point in the control flow in which the error is actually thrown. If not understood, this can lead to obfuscated ... more


Monday, 1 January, 2018 UTC

You've Kissed The Lips Of JavaScripts

Ben Nadel remembers the theme song from the Official jQuery Podcast. This song (by Jonathan Neal) always used to leave me smiling after every episode.... ... more


Friday, 29 December, 2017 UTC

Frameworks And Libraries Can Make You A Better JavaScript Programmer

Ben Nadel disputes the claim that frameworks and libraries prevent people from learning JavaScript. In fact, he argues the opposite: frameworks and libraries can make you a much better developer, forcing you to think differently and more deeply about ... more


Friday, 15 December, 2017 UTC

Note To Self: Adding Type Declaration Files To A TypeScript 2.6.2 Project

Ben Nadel documents some Type Declaration strategies for his own use in future TypeScript projects. This allows him to provide type-safety for ".js" files that he needs to consume alongside the rest of his TypeScript code.... ... more


Sunday, 26 November, 2017 UTC

Double-Parentheses ()() Requires Too Much Cognitive Load For My Brain

Ben Nadel shares the struggle he has with mentally parsing double-parentheses - ()() - which is a common syntax in the JavaScript and Node.js communities. Such expressions require more cognitive load than his caveman brain is able to provide.... ... more


Friday, 29 September, 2017 UTC

Building A Mental Model For Precedence And The "new" Operator In JavaScript

Ben Nadel looks at the mysterious "new" operator in JavaScript. And, attempts to build a mental model that makes it easy to understand when and why JavaScript will apply the "new" operator to a compound expression containing member ... more


Monday, 18 September, 2017 UTC

You Can Include Delimiters In The Result Of JavaScript's String .split() Method When Using Capturing Groups

Ben Nadel explores JavaScript's String.prototype.split() method, which will return the delimiters in the result-set if the given Regular Expression pattern uses a capturing group. This provides some new and fun ways to parse strings.... ... more


Friday, 18 August, 2017 UTC

Using Firebase 4 With TypeScript, Type Declarations, And npm

Ben Nadel demonstrates how to use Firebase 4 with TypeScript and type declarations. When using npm to load the Firebase module, the type definition file ships with the module itself.... ... more


Thursday, 3 August, 2017 UTC

Aggregating Cherry-Picked Lodash Methods In An Application Module In JavaScript

Ben Nadel demonstrates how to aggregate and package cherry-picked Lodash methods in an application module in JavaScript. This results in smaller bundles without sacrificing cohesive package mental models. And, makes it easier to keep versioned vendor ... more


Tuesday, 1 August, 2017 UTC

After 3 Months Of JavaScript Linting, It's Pretty Much All Pain And No Gain

Ben Nadel reflects on JavaScript linting after having used it for the first time in his career. From what he can see, linting is an all pain no gain kind of standard that adds an arbitrary layer of friction to the already-hard problem solving landscape.... ... more


Tuesday, 1 August, 2017 UTC

Using The Joyous Power Of Relative Dates To Calculate Days-In-Month In JavaScript

Ben Nadel discusses JavaScript ability to use relative values when instantiating or modifying Date objects. And, how this relative-date magic can be used to easily calculate how many days are in a given month.... ... more


Monday, 17 July, 2017 UTC

Parsing And Pretty-Printing JSON Values On-The-Fly In Loggly Using Bookmarklets

Ben Nadel demonstrates how to write Bookmarklets that are hosted on GitHub Pages. And, shares several of the Bookmarklets that he's created for Loggly that add better formatting and on-the-fly JSON (JavaScript Object Notation) parsing.... ... more


Friday, 14 July, 2017 UTC

You Can Use Arrays In Field Equality Checks Within A Sequelize WHERE Clause In Node.js

Ben Nadel demonstrates that you can use Arrays in direct field comparisons when writing Sequelize WHERE clauses. This is a construct that you might otherwise delegate to the "$in" operator. However, we can skip the nested object and create ... more