【问题标题】:for (var i = 0; i &lt; count; i++) { } == for (var i = 0; i < count; i++) { }. What is this notation and why use it? [closed]for (var i = 0; i < count; i++) { } == for (var i = 0; i < count; i++) { }。这是什么符号,为什么要使用它? [关闭]
【发布时间】:2019-06-18 02:09:38
【问题描述】:

遇到符号:

for (var i = 0; i &amp;lt; count; i++) { }

this tutorial。我认为它相当于:

for(var i = 0; i < count; i++) { }

这个符号是什么?为什么要使用它?效果更好吗?

【问题讨论】:

  • 这是网页中的一个错误(即他们的意思是说&amp;lt;)。 &amp;lt;&amp;lt; 的 HTML 代言词。另外,ericlippert.com/2012/12/17/performance-rant .
  • &amp;lt; 等于 &amp;lt;。这只是&amp;lt; 字符的html 编码。该字符可能只是没有在您正在查看的网站上正确编码。这称为“for-loop”函数,您可以使用它来遍历集合,例如数组。
  • w3schools.com/html/html_entities.asp 这个链接会对你有所帮助。

标签: c# performance for-loop scripting


【解决方案1】:

这是一个 HTML 解析错误。 &amp;lt; 应该显示为 &lt;。你是对的 - 它应该是i &lt; count

【讨论】:

    猜你喜欢
    • 2011-07-27
    • 1970-01-01
    • 2016-10-16
    • 1970-01-01
    • 2012-05-09
    • 1970-01-01
    • 2023-03-29
    • 2011-06-14
    • 2019-06-25
    相关资源
    最近更新 更多