{ All snippets }

Tweetsnippet is a curated list of tips and tricks from Twitter. Currently we have 564 snippets. Help by contributing here!

🔥 Writing that extra line that just has a return statement to return an object in my Vue component's data() method feels really bad every time. (Not to mention that data() is a method, not just an object 🤔) So I found a way to trim 2 lines using arrow functions 🚨 https://t.co/Qmlil4mqHD

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

John Papa

John Papa @John_Papa

🌟Tip of the day 🌟 I find this very helpful when working with node and npm The -- is a special flag that allows you to pass parameters to the underlying script? Did you know ? https://t.co/zNF7IQQDST

Alex Jover Morales

Alex Jover Morales @alexjoverm

✍️ Gotcha: If you access an instance property within the dynamic import function on a computed prop, it won't work. ✅ You must do it outside so that @vuejs is aware of that dependency. This is commonly used for dynamic components and code splitting ✄ https://t.co/KKiFEY1dms

Richard Ekwonye

Richard Ekwonye @ekwonye

Always remember that the HTML5 <video> has a poster attribute that accepts the url to an image that would be rendered while your video loads and until the video is played. Always comes in handy 👌🏽

Caleb Porzio

Caleb Porzio @calebporzio

🧳🧳 It's soooo easy to persist Vuex state to localStorage - just add this one line to your store... This makes it so you can refresh the page and all the changes you made will remain intact. https://t.co/Hqd1XthsKn