👑 Awesome one-liners you might find useful while coding. #javascript #codenewbie #100daysofcode #301DaysOfCode
 
                                            What's the name of this color scheme.. looks sick! By the way awesome share!
My favourite one is to easily review an array of objects in a nice table format using `console.table`: var data = [{...},{...},{...},{...},{...},{...}]; console.table( data ); Example: github.com/palashmon/java…
This is cool for play, but always remember that code is for human consumption. Especially the use of lambdas in the second example gets confusing fast. @getify
Regarding your random color snippet, you might like `Math.random() * 0xFFFFFF`. Should be easier to remember :).
I recently realized passing just console.log as a callback will log each argument out, because console.log can take any number of arguments #javascript
When I read one-liners I was ready for some js jokes!
when working with observables (rxjs) then is this very useful shortform: filter(Boolean). Thanks for the hint.
Be careful with very big numbers and ~~ (in fact any bitwise operator) as they get converted to 32 bit which may not give you the expected output!
I was tinkering: combine 2 of these... const add5 = n => console.log({n}) || n + 5;
I've probably spent hours bracketing arrow functions. Thank you!!
All of these seem to have been sourced from a two-week-old reddit post on r/javascript. It would be polite to attribute credit to the original authors ☺️ #javascript reddit.com/r/javascript/c…
Was really kind of hoping these were like Rodney Dangerfield style one liners. Couldn't make it work tho. Hey this is a rough crowd.
I didn't realise you could use none returning functions to do stuff with pipes, but I guess Javascript with evaluate console logging as falsy so it's valid, wow, this is why I love Javascript (but also equally hate it sometimes, especially when I forget zero evaluates as falsy)
afaik, random values include 0.0 but exclude 1.0 so you should multiply them by 16777216 (0x1000000)
United States Tendenze
- 1. Halloween 1.72M posts
- 2. YouTube TV 27.5K posts
- 3. ESPN 67.3K posts
- 4. Hulu 22.1K posts
- 5. Chris Grier 5,236 posts
- 6. #SwapSilently 2,178 posts
- 7. Travis Hunter 2,332 posts
- 8. YTTV 1,295 posts
- 9. #FanCashDropPromotion N/A
- 10. Trick or Treat 393K posts
- 11. Auda City 1,311 posts
- 12. Fubo 2,330 posts
- 13. Dearborn 11.1K posts
- 14. Champ Kelly N/A
- 15. Parker Washington N/A
- 16. #FridayVibes 4,720 posts
- 17. Reformation Day 3,654 posts
- 18. #FursuitFriday 11.9K posts
- 19. McDaniel 11.1K posts
- 20. #SpookySeason 7,310 posts
Something went wrong.
Something went wrong.
 
             
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
                                                     
                 
                 
                 
                 
                 
                 
                 
                 
                