The JavaScript Ninja
@jsninja
Here on Twitter I will sporadically divulge sensitive information regarding JavaScript and its various abstractions...
คุณอาจชื่นชอบ
Did you watch @paul_irish live-fix some performance issues on a site with janky scrolling yet? youtube.com/watch?v=HAqjyC…
JS Promises are the ones you don't make to yourself.
for (var i = -1, l = array.length; ++i < l;) // Yet another array looping 'pattern' (not original)
poll - "What identifier do you tend to use to reference out-of-scope contexts in your JavaScript code?" - twtpoll.com/tfvfko
Random value from array: ['which', 'word', 'i', 'wonder', '...?'][0|Math.random()*5]
~~n and n|n are the clear winners in the flooring benchmarks: http://ernestdelgado.com/archive/benchmark-on-the-floor/ (via @paul_irish)
Technically, you could use labelled compound statements ("blocks") to annotate pieces of code: http://bit.ly/an5l1U
http://www.spritely.net/ - Useful for CSS sprite animation
Answering Baranovskiy’s JavaScript quiz - http://www.nczonline.net/blog/2010/01/26/answering-baranovskiys-javascript-quiz/
Understanding Delete - http://perfectionkills.com/understanding-delete/
Instead of (new Date()).getTime() ... You can just do +new Date
Optimise your Waterfall! http://www.phpied.com/free-falling-waterfalls/
Degradation of skills as a result of JS libraries - http://bit.ly/7Kpnmy
Want a free copy of the new jQuery cookbook (O'Reilly)? http://james.padolsey.com/javascript/the-jquery-cookbook/
Quick indexOf failure trick: !~string.indexOf(something) .... No need for ==-1
And, obviously, the other comparison operators work in a similar fashion. "a" <= "b" && "c" > "a"
"alpha" < "bravo" ... You can use the less-than operator on strings! (helps with lexicographical ordering)
United States เทรนด์
- 1. Cowboys 70.9K posts
- 2. LeBron 94.5K posts
- 3. Gibbs 18.9K posts
- 4. Lions 87.1K posts
- 5. Pickens 13.2K posts
- 6. #OnePride 10K posts
- 7. Brandon Aubrey 7,016 posts
- 8. Ferguson 10.5K posts
- 9. #DALvsDET 6,095 posts
- 10. Eberflus 2,438 posts
- 11. CeeDee 10.2K posts
- 12. Goff 8,423 posts
- 13. Bland 8,435 posts
- 14. Shang Tsung 21K posts
- 15. DJ Reed N/A
- 16. Al Michaels N/A
- 17. Schotty 1,802 posts
- 18. scott hunter 2,690 posts
- 19. fnaf 2 23.9K posts
- 20. Austin Reaves 14.9K posts
คุณอาจชื่นชอบ
-
Nicholas C. Zakas
@slicknet -
Allie K. Miller
@alliekmiller -
JavaScript Jabber
@JSJabber -
Juriy Zaytsev 🇺🇦
@kangax -
cody lindley
@codylindley -
Vadim Demedes 🇺🇦
@vadimdemedes -
Alex Sexton
@SlexAxton -
Dmitry Soshnikov
@DmitrySoshnikov -
Progress Kendo UI
@KendoUI -
Christian Weyer
@christianweyer -
adam j. sontag
@ajpiano -
Ben Cherry
@bcherry -
JZ JavaScript Corner
@JoeZimJS
Something went wrong.
Something went wrong.