Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

1

(Extension of my comment above) It would be a better idea to use literal Unicode rather than HTML entities. The advantage of Unicode characters is that they are usable universally and not only when outputting HTML. If you don't like the literal characters in the source code, or find them hard them to read, then you can use JavaScript escape sequences with ...


4

Ways of improving/optimizations: What fixApostrophes and fixDashes functions actually try to do is replacing a specific punctuation chars with respective HTML entities. Instead of those numerous horrifying while loops - a more optimized, concise and extendable approach would be to: compose a predefined replacement map (where keys are search patterns and ...


2

Some suggestions: Rewrite the line of code app.get(['/bio', '/contact', '/login', '/works', '/404', '/bug', '/edit-bio', '/edit-works'] ... to be readable and maintainable and debuggable. It should likely be broken into at least two separate routes. Separate into different route definitions the paths that care about calling verify() and the ones that don't....


Top 50 recent answers are included