The JavaScript Ninja
@jsninja
Here on Twitter I will sporadically divulge sensitive information regarding JavaScript and its various abstractions...
Talvez você curta
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 Tendências
- 1. Comet 27.3K posts
- 2. Fame 55.3K posts
- 3. Amon Ra 1,035 posts
- 4. TPUSA 83.7K posts
- 5. Letitia James 15.1K posts
- 6. Oviedo 4,025 posts
- 7. Amorim 54.1K posts
- 8. Matt Campbell 1,325 posts
- 9. The Supreme Court 30.1K posts
- 10. Teslaa 1,980 posts
- 11. The Password 3,141 posts
- 12. #LightningStrikes N/A
- 13. Spaghetti 10.7K posts
- 14. fnaf 2 17.1K posts
- 15. ARSB N/A
- 16. #TakoTori1stConcert N/A
- 17. Ugarte 13.9K posts
- 18. #MissVenezuela2025 N/A
- 19. #drwfirstgoal N/A
- 20. Ingram 2,453 posts
Talvez você curta
-
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.