JavaScriptのベストプラクティス大会 jsEdu

詳細は"10 Free Copies of “JavaScript Patterns” from O’Reilly Books | Nettuts+" http://net.tutsplus.com/freebies/books/10-free-copies-of-javascript-patterns-from-oreilly-books/ 要は #jsEdu つけてJavaScriptのTips投稿してね。の検索メモ。 追記:一部取り出して日本語にしてみました。 続きを読む
13
前へ 1 ・・ 12 13 15 次へ
David Strauß @stravid

JS tip: Debugging with Firebug, use string substitution patterns in console.log("a: %o, b: %o", a, b); easier editing & more readable #jsEdu

2010-10-13 22:51:27
@scottpalmer

Try to use Array.Join instead of string concatenation, it's faster and doesn't create extra string objects. #jsEdu

2010-10-13 22:57:51
José @jamcc17

not rely on eval (), review better alternatives agree the circumstances #jsEdu

2010-10-13 22:59:21
Jon Randy @jonrandy

Always try to define vars at the top of functions to avoid confusion with variables being 'hoisted' #jsEdu

2010-10-13 23:02:12
Stefano Verna @steffoz

String.prototype.reverse = function () { return this.split('').reverse().join(''); } #jsEdu

2010-10-13 23:13:57
Yuya Saito @cssradar

Looks as if it was written by the same person, not just JS, these patterns could be same in css | #jsEdu | http://t.co/DqdrHtu

2010-10-13 23:57:10
paulwallace @paulwallace

Understand the difference between == and === 3 == "3" is true, 3 === "3" is false === compares value AND type #jsEdu

2010-10-14 00:31:57
@jyoseph

Avoiding implied typecasting! Always use the === and !== operators that check the values & the type of the expressions you compare #jsEdu

2010-10-14 00:32:47
@jyoseph

Use curly braces and be loved by friends and colleagues alike! Omit them and die a cold and lonely death. #jsEdu

2010-10-14 00:35:47
Keegan Watkins @keeganwatkins

Never append elements in a loop - build an HTML string in the loop and append all at once #jsEdu

2010-10-14 00:54:34
Keegan Watkins @keeganwatkins

the second argument to String.replace can be a function used to convert the value. #jsEdu

2010-10-14 01:11:31
Matt Anderton @SLCMatty

forget everything you think you know about variable scope! #jsEdu

2010-10-14 01:25:54
Jon Hume @humedini

Always feature detect rather than browser detect, you know it makes sense :) #jsEdu

2010-10-14 01:26:44
@oldschooller

If you spot the use of eval() in your code, remember the mantra “eval() is evil.” #jsEdu

2010-10-14 01:29:22
Don Whiteside™ @donw

Checking DOM collection sizes can be expensive. Cache the length of your for loop for an easy but effective performance improvement #jsEDU

2010-10-14 01:29:43
jajarvin @jajarvin

@nettuts I am new in the area of JavaScript. I really like to have this book. #jsEdu

2010-10-14 01:38:23
@Fcalderan

before writing a single line of javascript, seriously think if you can reach the same result in newest browser with only CSS =) -- #jsEdu

2010-10-14 01:46:54
Adrian Png 🧡🕯️ @fuzziebrain

Comment your code - appropriately - and keep them up-to-date. #jsEdu

2010-10-14 02:10:55
Pobzeb Armerding @pobzeb

Always end each JS statement with a ";" #jsEdu

2010-10-14 02:20:20
nato24 @nato24

Avoid using closures inside loops #jsEdu

2010-10-14 03:37:16
Paul Byers @cidermonk3y

Jscript tip: Avoid using eval() function, it slows down your code and can compromise your security, think XSS-remember, don't be eval #jsEdu

2010-10-14 03:55:43
@araniajain

Always end your JS statement with a ";" #jsEdu

2010-10-14 04:23:06
Roger Wakeman @rgrwkmn

Use callbacks in your functions/classes. Makes them useful in more circumstances w/o modification. #jsEdu #javascript

2010-10-14 04:28:54
@_cjo_

if you're writing javascript, you really should be using jslint! #jsEdu

2010-10-14 04:39:29
前へ 1 ・・ 12 13 15 次へ