Mark Rendle
Member since Nov 12, 2015
- Profile: /members/12913-mark-rendle.htm
- Comments: 4
Recent Blog Comments By Mark Rendle
-
Var For Life - Why Let And Const Don't Interest Me In JavaScript
Posted on Nov 13, 2015 at 4:43 AM
@Ben, Gotcha.... read more »
-
Var For Life - Why Let And Const Don't Interest Me In JavaScript
Posted on Nov 12, 2015 at 2:17 PM
@Ben, I guess, as a C# developer of 15 years, I'm used to having `readonly` variables and writing functions when there's a multi-step initialization. But I still maintain that having a two-line function called `trimWhitespace` is better than having a couple of regular expressions with comments expl... read more »
-
Var For Life - Why Let And Const Don't Interest Me In JavaScript
Posted on Nov 12, 2015 at 11:30 AM
The point of the `trimWhitespace` function name being that it removes the need for those two comment lines ;)... read more »
-
Var For Life - Why Let And Const Don't Interest Me In JavaScript
Posted on Nov 12, 2015 at 11:29 AM
I like 'em. Regarding your first sample, with the sanitize code, it should definitely be moved into a function, even if it's local to the script that uses it, just so you can give it a meaningful name like `function trimWhitespace(value)`. `const` makes your intent explicit, and stops you accident... read more »