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

null
Annoying #VueJS gotcha that cost us some time recently: you can't name a component "footer". Worked around it by naming it "footer-component" github.com/vuejs/vue/issues/… #JavaScript #CodeNewbie
2
3
3
Mastering JS retweeted
Node.js' built-in `assert` isn't just for tests! It is also a concise way to handle "if condition isn't true, throw error", no extra `if` required. Can even use Chai for extra syntactic sugar: masteringjs.io/tutorials/moc… #JavaScript #CodeNewbie
2
4
3
Node.js' built-in `assert` isn't just for tests! It is also a concise way to handle "if condition isn't true, throw error", no extra `if` required. Can even use Chai for extra syntactic sugar: masteringjs.io/tutorials/moc… #JavaScript #CodeNewbie
2
4
3
The Mastering JS website is 100% open source. Check it out on GitHub, and please star our repo! github.com/mastering-js/mast…
1
1
Pro tip: `type: 'asset/source'` in Webpack lets you import selected files as plain text. For example, with the below Webpack config, you can `import` CSS files to get the CSS file as a string #JavaScript #CodeNewbie
1
2
1
Love our tutorials? Sign up for our weekly newsletter and never miss a tutorial! getrevue.co/profile/masterin…
JavaScript strings have a `contains()` method that checks if the string contains a substring. But IE doesn't support `contains()`, so use `indexOf()` for frontend: masteringjs.io/tutorials/fun… `indexOf()` was part of the first JavaScript spec in 1997! #JavaScript #CodeNewbie
1
1
2
The Mastering JS website is 100% open source. Check it out on GitHub, and please star our repo! github.com/mastering-js/mast…
Two ways to shallow copy an array in JavaScript 👉 masteringjs.io/tutorials/fun… #JavaScript #CodeNewbie
1
1
Mastering JS retweeted
Pro tip: `eslint . --fix` makes ESLint try to fix any warnings and errors. Doesn't work for all ESLint rules, but can save you a lot of repetitive work. Learn more 👉 masteringjs.io/tutorials/esl… #JavaScript #CodeNewbie
1
3
7
Pro tip: `eslint . --fix` makes ESLint try to fix any warnings and errors. Doesn't work for all ESLint rules, but can save you a lot of repetitive work. Learn more 👉 masteringjs.io/tutorials/esl… #JavaScript #CodeNewbie
1
3
7
The Mastering JS website is 100% open source. Check it out on GitHub, and please star our repo! github.com/mastering-js/mast…
TIL: if you're writing an executable script, better to use `/bin/bash` rather than `/bin/sh` In Ubuntu, `/bin/sh` uses a slightly different shell than bash: stackoverflow.com/questions/… #CodeNewbie #100DaysOfCode
1
1
1
Love our tutorials? Sign up for our weekly newsletter and never miss a tutorial! getrevue.co/profile/masterin…
Switch/case statements are great when an early return is inelegant because you don't want to repeat a non-trivial `return`. `break` breaks out of the switch statement 👍 masteringjs.io/tutorials/fun… #JavaScript #CodeNewbie
2
Pro tip: you can append CSS to your page by creating a `style` tag. Handy when loading styles using `import` or `require()` with Webpack #JavaScript #CodeNewbie
3
2
Love our tutorials? Sign up for our weekly newsletter and never miss a tutorial! getrevue.co/profile/masterin…
Mastering JS retweeted
AngularJS EOL: the end of an era 😢 infoworld.com/article/364660… #JavaScript #100DaysOfCode
1
3
3