---
title: "Electron 6, a String#replace trick, and learning about scope in JS"
publication: "JavaScript Weekly"
issue: 448
published_at: "2019-08-02"
canonical_url: "https://javascriptweekly.com/issues/448"
---

This week's JavaScript news        

#448 — August 2, 2019 

[Read on the Web](https://javascriptweekly.com/issues/<!--%20\\id%20-->)   

JavaScript Weekly 

![](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1564761454/yxzbmrchphu8andxdzrt.jpg)  

[Hotkey: Trigger an Action on an Element When a Keyboard 'Hotkey' is Pressed](https://github.com/github/hotkey) — Want quick and simple keyboard shortcuts for elements on your page? Set the `data-hotkey` attribute and use Hotkey. It even supports multiple keys pressed in sequence. GitHub built and uses it (view source on any GitHub page and look for the `data-hotkey` attributes). 

GitHub   

[Writing a Simple MVC App in _Plain_ JavaScript](https://www.taniarascia.com/javascript-mvc-todo-app/) — If you’re tired of hearing about React, Angular, Mithril, Ember, and the rest, and _just want to write JavaScript_, this might be the tonic for you. (Ultimately, all of those frameworks are _very useful_ but being able to work _without_ them first will help you appreciate what they do!) 

Tania Rascia   [![\](https://copm.s3.amazonaws.com/08103eef.jpg)](https://frontendmasters.com/courses/gatsby/?utm_source=jsweekly&utm_medium=email&utm_campaign=gatsby) 

[New Introduction to Gatsby Course with Jason Lengstorf](https://frontendmasters.com/courses/gatsby/?utm_source=jsweekly&utm_medium=email&utm_campaign=gatsby) — Build blazing 🔥 fast website by default with Gatsby! In this course, you'll build up a blog from scratch and deploy your brand new blog to Netlify for the world to see! 

Frontend Masters sponsor    

[Electron 6.0 Released](http://electronjs.org/blog/electron-6-0) — Just 3 months after version 5 was released, the popular JavaScript-based cross-platform desktop app building platform hits version 6 and uses Chromium 76, Node 12.4, and V8 7.6 under the hood. 

Electron.js Team   

[Did You Know `String.prototype.replace` Supports Replacement Patterns?](https://www.stefanjudis.com/today-i-learned/string-prototype-replace-supports-replacement-patterns/) — It feels a bit Perl-like, but this is an interesting feature I’d never seen in JavaScript before (despite [being in the MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_string_as_a_parameter)). Example: `'abc'.replace('b', '$&-$&') === 'ab-bc'` 

Stefan Judis   

[Taking Redux Off of the Main Thread with Comlink](https://dassur.ma/things/react-redux-comlink/) — Using Web Workers carefully can yield major UX and performance benefits by taking computation off of the UI thread. Here’s one way to do it when using Redux. 

Surma     

**Quick bytes:** 

- [VueConf US 2020](http://vueconf.us/) is taking place on March 2-4 in Austin, Texas. The CFP opens on September 1.
- The Ember project has [published a roadmap for its future.](https://github.com/emberjs/rfcs/blob/2018-2019-roadmap/text/000-2018-2019-roadmap.md)
- [Amazon Transcribe](https://aws.amazon.com/transcribe/), AWS's speech-to-text service, [now supports WebSockets for streaming, real-time transcription.](https://aws.amazon.com/blogs/aws/amazon-transcribe-streaming-now-supports-websockets/)
- Chrome is [going to hide the 'www' subdomain](https://bugs.chromium.org/p/chromium/issues/detail?id=883038#c114) and 'https' scheme in its location bar to make URLs 'easier to read'.
- Kyle Simpson [has started work](https://twitter.com/i/web/status/1157010588658282496) on the 2nd edition of his popular [You Don't Know JavaScript](https://github.com/getify/You-Dont-Know-JS) book series.     

💻 Jobs  

[JavaScript Developer at X-Team (Remote)](https://x-team.com/remote-javascript-developer-jobs/?utm_source=cooperpress&utm_medium=email-ad&utm_campaign=js) — Join the most energizing community for developers. Work from anywhere with the world's leading brands. 

X-Team   

[Front-end Engineer](https://goldstar.workable.com/j/43A556792B) — Goldstar is looking for Front-end Engineers with React expereince onsite in Portland, Oregon and Pasadena, California. 

Goldstar   

[Get Hired Based on Your Skills Not Your CV](https://hackajob.co/p/discover?utm_source=cooperpress&utm_medium=paid&utm_campaign=jw_aug-2) — Our AI makes it easier and quicker to match with top JavaScript jobs, with no recruiters and an average salary of £70k. 

hackajob  

📘 Tutorials, Opinions, and Videos 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1564761084/p6agf327rmquaz6267h7.png)](https://www.youtube.com/watch?v=5LEuJNLfLN0)  

▶[Let's Learn About Scope in JavaScript](https://www.youtube.com/watch?v=5LEuJNLfLN0) — Google’s dynamic JavaScript duo, Jake and Surma, present an entertaining chat about variable scoping, complete with tablet-based demos. 

Google Chrome Developers   

[Looking at the Optional Chaining ES Proposal](https://2ality.com/2019/07/optional-chaining.html) — Boils down [the proposal](https://github.com/tc39/proposal-optional-chaining) to exactly the essentials you need to know. 

Dr. Axel Rauschmayer   

[The Developer’s Guide to Not Losing the Metrics You Need](https://www.influxdata.com/blog/the-developers-guide-to-not-losing-the-metrics-you-need/?utm_campaign=ruby&utm_medium=newsletter&utm_source=cooperpress) — Gathering and storing metrics is a part of production. When adverse events occur, you need to have the metrics available to debug the problems. 

InfluxData sponsor   

[Do React Hooks Replace Redux?](https://medium.com/javascript-scene/do-react-hooks-replace-redux-210bab340672) — This question has bounced around in the community a lot recently as more use cases for hooks emerge.. but Eric’s TLDR is _‘Hooks are Great, but No.’_ and he explains why in depth. 

Eric Elliott   

[Getting Started with Vuetify 2.0](https://medium.com/vue-mastery/getting-started-with-vuetify-2-0-522ad3a55154) — [Vuetify](https://github.com/vuetifyjs/vuetify) is a Material Design-based component library for Vue.js. 

Ben Hong   

[Quick Tips for Using Mocks when Unit Testing with Jest](https://danielcaldas.github.io/posts/tips-jest-unit-testing/) 

Daniel Caldas   

[First-Class Functions in JavaScript](https://nick.scialli.me/first-class-functions-in-javascript/) — A brief tutorial aimed at beginners who might be wondering why being able to treat functions as first-class citizens (i.e. as objects in their own right) has merit. 

Nick Scialli   

[Top 10 GitHub Best Practices - Lessons from Thousands of Repositories](https://try.datree.io/github-best-practices-guide?utm_source=cooperpress&utm_medium=jsweekly) 

Datree.io sponsor   

[My VS Code Setup: Making The Most Out of VS Code](https://dev.to/deepu105/my-vs-code-setup-making-the-most-out-of-vs-code-4enl) — A grab bag of addons and tools to consider if you’re a VS Code user. 

Deepu K Sasidharan   

[Understanding RxJS Observables and Why You Need Them](https://blog.logrocket.com/understanding-rxjs-observables/) — [RxJS](https://rxjs-dev.firebaseapp.com/) is a reactive programming library based around ‘observables’ and is used by Angular for its reactivity.. but you can use it separately too. 

Nwose Lotanna  

🔧 Code and Tools  

[Hackathon Starter: A Boilerplate for Node Web Apps](https://github.com/sahat/hackathon-starter) — A boilerplate for when you want to start building a Node app _quickly_ (such as at a hackathon) as it includes almost everything you’d need. 

Sahat Yalkabov   

[Esprint: Runs ESLint Across Multiple Threads for More Performance](https://github.com/pinterest/esprint) — It’s been [considered](https://github.com/eslint/eslint/issues/3565#ref-issue-250345980) that this could be merged into ESLint itself. 

Pinterest   

[Ensure That Your Code Is Error-Free Before Merging](https://lp.codacy.com/code-review?utm_source=CooperPress&utm_medium=cpm&utm_campaign=CooperPress-JSSL) — Set standards on coverage, duplication, complexity, and style issues and see real-time feedback in your Git workflow. 

Codacy sponsor   

[Treeverse: Walk Tree Structures Depth- or Breadth-First](https://www.npmjs.com/package/treeverse) 

Isaac Z Schlueter   

[Rollup: A Modern ES6 Module Bundler](https://github.com/rollup/rollup) — Not a new project, but it's been getting plenty of releases lately. Write your code using ES modules and get tree-shaking/dead code elimination and bundling to the format you require. One of Rollup’s wins over more popular alternatives is its _speed_. 

Rollup Contributors   

[Top 25 JavaScript Plugins for WebStorm and IntelliJ](https://blog.codota.com/top-25-javascript-plugins-for-webstorm-intellij/) 

Ilana Brudo     

⚡️ Quick Releases 

- [Font Awesome 5.10.0](https://github.com/FortAwesome/Font-Awesome/releases/tag/5.10.0) — the popular icon toolkit.
- [webpack 4.39.0](https://github.com/webpack/webpack/releases/tag/v4.39.0) — 'everything but the kitchen sink' bundler.
- [TUI Editor 1.4.5](https://github.com/nhn/tui.editor) — Markdown-based WYSIWYG editor.
- [Spectacle 5.7](https://github.com/FormidableLabs/spectacle) — React.js-based presentation library.
- [Duktape 2.4](https://github.com/svaarala/duktape) — embeddable JavaScript engine for C/C++ projects.            

Curated by [Cooperpress](https://cooperpress.com/) and [Peter Cooper](https://twitter.com/peterc). 

'JavaScript' is a trademark of Oracle Corporation in the US
We are not endorsed by or affiliated with Oracle. 

[Change your email address](https://javascriptweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://javascriptweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
