-4
A
回答
2
是你的同事很可能指的是在某些情況下爲變量賦值,每次比檢查一些條件,然後分配給它更快。
var a = 2;
function slower() {
if (a !== 0)
a = 0;
}
function faster() {
a = 0;
}
真的不過,這是很荒謬的考慮單一if
聲明考慮到現在的計算機有多麼強大的性能影響。
相關問題
- 1. live('click')and performance
- 2. Javascript performance for property access:undefined vs false
- 3. Reflection.Emit Performance
- 4. Neos Performance
- 5. Select performance
- 6. Swift Performance
- 7. 在嵌套ifelse中正確使用「不是」「或」「」AND「布爾值
- 8. Rails serverside handlebars performance
- 9. Javascript Alerts and Prompts
- 10. Javascript try and catch
- 11. Javascript,Canvas,and Resizing
- 12. Javascript。 | &and toString
- 13. HTML and javascript colab
- 14. javascript and currying
- 15. Javascript Getters And Setters
- 16. Javascript variable and smarty
- 17. Javascript - Regexes and lazyness
- 18. Javascript Division and Multiplication
- 19. Spark Slow Performance
- 20. std :: map performance C++
- 21. Presto Cassandra Slow performance slow
- 22. silverlight xaml staticresouce performance
- 23. QTMovie addImage performance
- 24. stringtokenizer java - performance
- 25. qt performance - OpenGL
- 26. Mongo $ in operator performance
- 27. mod_wsgi-express slow performance
- 28. Firebug&Performance Question?
- 29. Laravel 4 Facades Performance
- 30. RowVersion和Performance
你的傢伙不知道JavaScript?沒有這樣的if-then語句。如果 - 別的也許。 – elclanrs
爲什麼不用手寫代碼?那就拍攝了 – 2013-03-30 08:16:09