Scott Rippey
Member since May 18, 2015
- Profile: /members/12662-scott-rippey.htm
- Comments: 6
Recent Blog Comments By Scott Rippey
-
I Prefer The Unary Plus (+) Operator Over parseInt() And ParseFloat() When Coercing Strings To Numbers In JavaScript
Posted on Apr 6, 2020 at 12:16 PM
I prefer using Number('100') , because it's an explicit function call, so it's easier to read. It's functionally identical to unary + ... but using the unary operator is much harder to read and feels like a hack. There is a microscopic performance advantage to + , if that outweighs co... read more »
-
Using Guard Conditions To Short-Circuit Object-Spread Operations In TypeScript 3.2.4
Posted on Mar 29, 2019 at 1:07 PM
This is great, I had no idea "falsey" objects could be not-spread! Very elegant, inline solution ... whereas other "conditional" approaches are always really ugly! I've done something similar with Array spread before. It was nice to have this logic inline, but it's ugly,... read more »
-
How I Format The Conditional Ternary Operator In ColdFusion And JavaScript
Posted on Oct 19, 2016 at 11:05 AM
In my head, the "?" and ":" actually make the sounds "hmmmm?" and "neeehhhh" ;)... read more »
-
Writing Conditional SQL Statements Using Nested Tagged Template Literals In Node.js
Posted on Jul 12, 2016 at 1:14 PM
Ben, I went down the same exact path as you! Conditional blocks are a huge missing feature, so I implemented the same "tag function" that omits falsey values. I was bummed that you have to "tag" the nested templates too, but that's not too big a deal. I found that there's 2 mor... read more »
-
Leverage CSS user-select For A Better User Experience (UX)
Posted on Oct 26, 2015 at 11:17 AM
Interesting. What do you think about applying this as a "blanket rule" to selectable elements? ``` a, button, label, [ng-click] { user-select: none; } ```... read more »
-
Canceling A Promise In AngularJS
Posted on May 18, 2015 at 3:56 PM
Ben, I've done a lot of work with the WinJS platform (for HTML-based Win8 apps and Xbox One apps). Interestingly, the WinJS.Promise implementation DOES support cancellation. And let me say, in my real-world experience, this feature has proven itself INVALUABLE! Within my Single-Page-Application, ... read more »