Bite sized JavaScript tutorials for busy developers Follow us on Substack: masteringjs.substack.com

null
Convert a set to an array for calculating intersection with another set 😎 Learn more about converting a set to an array 👉 masteringjs.io/tutorials/fun… #JavaScript #CodeNewbie
1
1
100
🆕 What Does Setting the Length of a JavaScript Array Do? masteringjs.io/tutorials/fun… #JavaScript #CodeNewbie
1
76
Sort an object's keys in alphabetical order 🆒 Learn more about sorting by properties in JavaScript 👉 masteringjs.io/tutorials/fun… #JavaScript #CodeNewbie
1
1
87
Node's built-in `assert()` takes a 2nd param that lets you specify the error message that Node will throw if the first param is falsy This is handy for user-friendly error messages without if statements More about assert in Node 👉 masteringjs.io/tutorials/nod… #NodeJS #CodeNewbie
2
162
Love our tutorials? Sign up for our weekly newsletter and never miss a tutorial! getrevue.co/profile/masterin…
17
`Array(30).fill(null)` makes it easy to create an array of 30 objects (or any number you want) as a one-liner More about mapping arrays in JavaScript 👉 masteringjs.io/tutorials/lod… #JavaScript #CodeNewbie
1
1
2
108
ObjectRouter: define an Express router based on object structure. Optional transform for changing API names from camel case to kebab case 😎 More about Express routers 👉 masteringjs.io/tutorials/exp… #NodeJS #100DaysOfCode
1
84
You don't need state management in Vue 3 1️⃣ Provide/inject solve prop drilling 2️⃣ Vue rendering doesn't prop diff, so minimal perf benefit to mapping state We find ourselves just doing `Vue.provide(state)` and calling it a day masteringjs.io/tutorials/vue… #VueJS #CodeNewbie
1
1
150
TIL putting a `p` tag in an `a` tag is invalid HTML 🧐 So thankful for 12 year old SO questions: stackoverflow.com/questions/… #CodeNewbie #100DaysOfCode
2
1
117
Love our tutorials? Sign up for our weekly newsletter and never miss a tutorial! getrevue.co/profile/masterin…
12
Use `filter()` and `reduce()` to strip out all keys that don't start with "param-" from an object. Request headers, in this case. More about filtering an object by key in JavaScript 👉 masteringjs.io/tutorials/fun… #JavaScript #CodeNewbie
1
2
2
169
Vue computed properties can be helpful for accessing component-specific constants in your templates Learn more about computed properties 👉 masteringjs.io/tutorials/vue… #VueJS #CodeNewbie #JavaScript
1
1
95
Add a session header to every Axios request using Axios interceptors 🆒 More about interceptors 👉 masteringjs.io/tutorials/axi… #JavaScript #CodeNewbie
1
96
Love our tutorials? Sign up for our weekly newsletter and never miss a tutorial! getrevue.co/profile/masterin…
17
We love modals in Vue, but sometimes we also need a vanilla JS modal. Here's how. Same CSS, etc. as here 👉 masteringjs.io/tutorials/vue… just slightly different JS #JavaScript #CodeNewbie
1
1
114
🆕 Get the Last Element in an Array in JavaScript: masteringjs.io/tutorials/fun… #JavaScript #CodeNewbie
1
1
2
95
Mastering JS retweeted
We love this pattern: a `/api/status` endpoint that displays 1️⃣ Current package.json version 2️⃣ Current environment Makes it easy to double check what's in prod, and make sure you're not talking to prod Check out our ExpressJS tutorials 👉 masteringjs.io/express #NodeJS
2
3
3
171
The Mastering JS website is 100% open source. Check it out on GitHub, and please star our repo! github.com/mastering-js/mast…
17