{ Javascript snippets }

R. Alex Anderson 🚀

R. Alex Anderson 🚀 @ralex1993

🔥🔥🔥 Tip: awaiting is an execution-blocking operation, as in the rest of the function won't execute until the awaited promise is resolved. Run promises concurrently by awaiting references to the already executed promises! (You can also do this with Promise.all()) https://t.co/Vp1C6pOXkJ

Katie Hempenius

Katie Hempenius @katiehempenius

How to view your connection speed from DevTools: > window.navigator.connection - This is the "NetworkInformation API" - It returns bandwidth, latency, & connection type approximations👇 https://t.co/nlCTIWiaTH

JavaScript Teacher

JavaScript Teacher @js_tut

Type in Chrome console: const obj = { } Then type: copy( obj ); Result: const obj = { } will be copied to clipboard. Paste it into your text editor. Works with any currently defined object. Makes debugging a lot easier – used it 1000+ times @ work.

Wes Bos

Wes Bos @wesbos

? If you are trying to debug something in the middle of chaining array methods, just map over it, console.log, and return it. Since console.log returns nothing, it will just pass the entire array through. You can even make a handle little debug function ? https://t.co/HCtLh4QYm6

TIL: `document.getElementsByClassName()` & Co return _live_ `NodeList`s. `document.querySelectorAll()` returns a _static_ `NodeList`. Use `querySelectorAll()`, people! https://t.co/s7aGuxMGgN

Kyle Pollich

Kyle Pollich @kylepollich

Nifty trick I've seen around and heard about on @syntaxfm - Array.from({ length: n }) gives you an array full of undefined that you can use in place of traditional for loops. Super handy for executing something a set number of times! https://t.co/AyUK8HtETe